Patent protection usually ends when the patent expires. Here are the expiration dates:
A patent may expire if its owner fails to pay required maintenance fees. Usually this occurs because attempts to commercially exploit the underlying invention have failed and the patent owner chooses to not throw good money after bad.
Patent protection ends if a patent is found to be invalid. This may happen if someone shows that the patent application was insufficient or that the applicant committed fraud on the U.S. Patent and Trademark Office (USPTO), usually by lying or failing to disclose the applicant's knowledge about prior art that would legally prevent issuance of the patent. A patent may also be invalidated if someone shows that the inventor engaged in illegal conduct when using the patent -- such as conspiring with a patent licensee to exclude other companies from competing with them.
Once a patent has expired or has been invalidated, the invention described by the patent falls into the public domain: it can be used by anyone without permission from the owner of the expired patent. The basic technologies underlying television and personal computers are good examples of valuable inventions that are no longer covered by in-force patents.
The fact that an invention is in the public domain does not mean that subsequent developments based on the original invention are also in the public domain. Rather, new inventions that improve public domain technology are constantly being conceived and patented. For example, televisions and personal computers that roll off today's assembly lines employ many recent inventions that are covered by in-force patents.