The law says 2 months. If the 3 months vs 2 months as required by law was the only issue I believe a person could challenge this in spite of what some local office says.
It may be prudent to apply up to 30 days before the expiration date. You still get the years extension but this allows you to work out any details vs trying to do so a day or so before expiration.