Patent protection usually ends when the patent expires. For design patents, the period is 14 years from date of issuance. For plant patents, the period is 17 years from date of issuance. 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 PTO, usually by lying or failing to disclose the applicant's knowledge about prior art that would legally prevent issuance of the 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.