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.
The ask:thailand community, consisting of multiple Q/A groups with over 100,000 members, powers this platform. It is not an official government resource. Our members actively contribute to this resource, and while we strive for accuracy, we cannot guarantee its complete reliability. Assistance to travelers is provided as a community service.