Apple unveiled its Series 2 Apple Watch almost two weeks ago, on September 7, 2016. If you were late to a coffee meeting because you were watching the entire keynote like me (and mentally calculating how much you were going to spend on all the new gadget), you know about the water expulsion feature of the new Watch. Today, the USPTO granted Apple its patent for this feature, again about two weeks after the unveiling. How did Apple obtain the patent just in time (pun intended) for the release of its product that is claimed in the patent?
Part of the timing has to do with luck. Average prosecution time in the US is two to three years (meaning that you may obtain a utility patent within two to three years of filing). If you ask for expedited prosecution*, it will likely take less time, but there are various factors that influence the duration of prosecution of a patent application. Here are three main ones: 1) your art unit; 2) your patent examiner; 3) response time.
When you file a patent application, it is assigned to an art unit depending on the technical field of your invention. Sometimes you're able to guess which art unit you will enter, but some art units are closely related so you never know. Some art units are busier than others. Most art units that deal with computer-implemented inventions have pretty big backlogs. Patent examiners are organized by art unit, which brings me to my next point.
Patent examiners are human beings and some can breeze through their docket while others take their time. If you have examiners who don't work as fast or have other responsibilities, it will take longer to examine your application. You will be randomly assigned to a patent examiner. There is no way to know who your examiner will be. You cannot choose your own examiner. And once you're assigned an examiner, he or she will be your examiner for the duration of the application unless under extraordinary circumstances.
Response time (i.e., to office actions or other office correspondence) can depend on applicants or examiners. I usually respond to office actions within shortened statutory deadline to keep applications moving during prosecution. But generally, applicants have six months to respond to office actions. If you take the full six months and take more time to respond to office actions, it will delay the prosecution process.
One more factor that I did not list above is office actions/prior art references that are cited during prosecution. This is an obvious one, but if you keep receiving office actions, then it will extend the prosecution period. Sure, you can do patent searches but there's really no way to accurately predict exactly how many office actions you will receive and how the prosecution process will go in general.
Overall, it probably is not a bad idea to ball park it and file patent applications about 2-3 years before product launch. This seems like a long time, but you can establish a filing date and then still spend time doing further R&D. With that said, it does not mean that it's too late to file an application if you're ready to launch something a month later. It just means that your patent application will be pending for the first months/years your product is in the market and there won't be a patent to enforce.
* Under Track One, you will receive a final disposition of your application within twelve months of filing. If you continue prosecution after receiving a final action, that second round of prosecution will not be expedited. But if you receive a notice of allowance during your first round of prosecution, you can presumably obtain a patent within approximately twelve months of filing.