Applying for a patent is a fairly simple process procedurally, but it can have many challenges the more complex the invention is. Patents are filed through the U.S. Patent and Trademark office, and additionally can be filed internationally to protect your patent overseas. There are professional companies such as Invent Help that could help you with this. Under current U.S. patent law, a patent will last for 20 years from the date is was officially filed on, but this can be extended via petition.
Patents and patent law can be quite confusing and a little overwhelming for entrepreneurs, startups, to even public companies. It is always highly suggested that you consult with an experienced patent agency like InventHelp to help you with any questions you would have regarding a patent, filing a patent, a patent search, and/or if someone has infringed on your patent.