How many time can a company apply for the same patent after it was rejected? Can you apply as many time as you want as long as you pay the fee to apply for a patent, or is there a hard limit on this? Let's assume that the country is the United States.
In the most likely case No, but you can make it happen!
First - almost every patent is rejected - at first. Then you respond to the office action rejection by arguing and/or amending and - guess what - you are likely to get a final rejection. That means the rejection is final until you pay them more money to file a Request for Continued Examination and get two more go-arounds with them.
Can you keep doing this? Yes. A previous director of the USPTO tried to make a rule that limited the number of RCEs - the courts knocked it down.
If you give up and let it go abandoned by not responding to an office action within the statutory limit (6 months) then the process of that application is over. If you have not filed a co-pending application before the initial application went abandoned then you are really starting over if you file a new application.
The original application can be used against any new application on a similar subject matter if it has been published. But it might not have published.
The law (35 USC 102) contains -
(a) NOVELTY; PRIOR ART.—A person shall be entitled to a patent unless— (1) the claimed invention was patented, described in a printed publication, or in public use, on sale, or otherwise available to the public before the effective filing date of the claimed invention; or (2) the claimed invention was described in a patent issued under section 151 , or in an application for >patent published or deemed published under section 122(b) , in which the patent or application, as the case may be, names another inventor and was effectively filed before the effective filing date of the claimed invention.
Your application may or may not have been published.
Then it is neither published or issued and does not fall under prior art under 102 or 103.
Applications are automatically published by the USPTO at the 18 month point unless you requested non-publication. In that case if your application never issues it is never public and can't be used against you or anyone else as prior art. You could even decide to keep it a trade secret.
Before the publication process came into being as part of TRIPS, an applicant could wait until they saw the claims that had been allowed and the patent was ready to go. If they didn't feel the claims were valuable enough they can chose to explicitly abandon and keep it secret.
Generally a patent rejection is binding and final.
An idea that has been disclosed can't be patented without a certain period of time after the disclosure, and the patent application process constitutes such a disclosure. Also, since there is only one patent agency in a country, it will generally honor its previous rulings.
For this reason, the process of getting a patent application approved needs to be continued in the initial application, possibly with amendments in the course of the process, in the vast majority of cases.