Yes, I should have been more specific as the rules are different for different visa types. For a 30 day visa exempt or a SETV, the 30 day extension can only be applied for 5 days before the permitted to stay date stamped in the passport on entry.
This is all very simple. You enter Thailand on day X. Your passport is stamped via various means with date Y that you must leave the country by. If the difference between X and Y is less than 90 days you do not have to report. If the number of days between X and Y Is greater than 90 days, you have to report to immigration every 90 consecutive days you are in the country. These dates have nothing to do with the enter by date on the Visa. Date Y Is the date stamped into your passport on entry or extension that you're permitted to remain in the country until. You must leave before the permitted to stay date or get an extension of stay stamp permitting you to stay longer. Also if you are on an extension of stay and wish to leave the country and re-enter on that same extension of stay, you need a re-entry permit.
The earliest you can go is 5 days before visa expires, I always go early when extending, especially handy if they are busy or change the rules at the last minute.
Not entirely true. I have one, got it in my home country, cost $200, and I had to provide photo and flight itinerary to Thailand. No other documentation required.