For stays up to 30 days a visa is stamped in your passport on arrival.

For stays up to 60 days you need to get a tourist visa from a Thai Consulate before you travel.

You can get a visa for longer than 60 days. Check with the Thai Consulate in your area.