While the time for obtaining a registered patent is dependent on the jurisdiction and technology involved, the timeframe for prosecution (filing, examination, amendments to overcome objections, acceptance and registration) typically falls within the period of 2-5 years.
Some jurisdictions allow for expedited examination under certain circumstances.