Visitors from most countries are issued 2- to 4-week entry permits on arrival and upon presentation of a passport and a ticket for the return or onward journey. Entry permits cannot be extended while you are in Thailand. It is advisable to check with a Thai embassy or consulate in your country before departure.
If you are planning a longer stay, apply for either a 60-day tourist visa or 30-day transit visa from Thai embassies and consulates overseas. These can be extended at the Immigration Office in Bangkok for a nominal fee.