For most countries, you can get a visa-on-entry which is valid for 30 days. If you wish to stay longer, you can extend this visa by another 30 days by visiting a local immigration office, and paying 1900 baht (plus often half a day of your time).
If you want to stay longer, you can apply from your home country and get a 60 day tourist visa. This can then be extended for another 30 days (with ditto time & money involved as above).
Please note, your passport must be valid for 6 months AFTER your overseas travel is completed.