The short answer: 20 years, subject to the payment of periodic renewal fees.
The slightly longer answer is that the maximum is 20 years, running from the filing date, not the priority date. The filing date is the date on which the application was actually filed in the relevant country. Applications can also claim an earlier “priority” date from another country, up to a year before the filing date, so in fact the patent system allows the rights to continue for up to 21 years from the very first filing.
Most countries require they payment of periodic renewal fees, typically every year on or about the anniversary of the filing date. In most countries, these are payable once the patent is granted. Some jurisdictions, such as the European Patent Office and Canada, also charge renewal fees while the application is still pending. Generally, you can check with the relevant Patent Office website to see if the renewal fees are up to date.
Special rules apply to US patents, as ever.