I read on https://www.dontworryjusttravel.com/asiapacific/thailand/thailand-60-day-tourist-visa/#How_to_extend_your_stay_for_30_more_days_without_getting_a_Thailand_tourist_visa:
Can I extend my tourist visa in Thailand? If you entered Thailand and received a 30 day stamp in your passport (this is called a 30 day visa exemption) – you can also extend a 60 day tourist visa by 30 days to a total of 90 days for the same fee – you can extend this stamp a further 30 days at any Thailand immigration centre for a fee of 1900 Baht.
Can one extend one's 30-day visa-free stamp any time before the stamp's expiration one wants or can one extend it only when close to the expiration? For example, can one extend the 30-day visa-free stamp just the day after getting the stamp when entering Thailand?