If you have an extension of stay or simple permit to stay (of a tourist or non immigrant visa), but would like to travel outside Thailand for a short period then you will need to apply for a Re-Entry permit.
You need to obtain the re-entry permit before you travel at:
Photocopy of passport (main page and latest entry stamp)
The current fees for re-entry permits are as follows:
1,000 Baht for single
3,800 Baht for multiple
The fees at the airport may be higher than the fees at the local immigration office.
Re-entry permits can be applied for in person or by an agent at Thai immigration office. If an agent is used, a letter of attorney is required.
The processing time at Thai Immigration offices can vary from 1 hour to half a day, so if you prefer to queue, apply before lunch so you can pick it up later the same day.
Please know that the re-entry permit does not prolong your visa or permit to stay. It is just a permit to be able to return to Thailand and use the remaining days of your permit to stay or extension of stay. Remember when arriving back into Thailand, you must note the re-entry permit number on the Immigration.