Thailand has a multitude of visa options and requirements -- you're best off going to the horse's mouth at the Thai Ministry of Foreign Affairs for the full spiel.
For most regular tourists, you have two primary options: You can get a Tourist-visa in advance at a Thai embassy or consulate or you may be eligible for a visa-waiver upon arrival. This is valid for 30-days if you arrive by air but for many nationalities, only 15 days if you arrive by land.
From the Travelfish blogs
How to get a Thai visa in Cambodia
How to get a Thai visa in Indonesia (Bali)
How to get a Thai visa in Laos (Savannakhet)
How to get a Thai visa in Laos (Vientiane)
How to get a Thai visa in Malaysia (Kuala Lumpur)
You can leave Thailand and re-enter Thailand to get another 30 days for a total duration of 90 days within 6 months (assuming each time you arrive is by air). This means, for example, if you're planning a trip to Thailand, Laos and Cambodia, which involves four stays in Thailand of ten days each, you DO NOT NEED to get a visa in advance -- AS LONG AS YOU ARE NOT PLANNING BACK TO BACK VISA RUNS. However if one of the stays is longer than 15 days, and you're arriving by land, you will need a tourist visa. If you're planning on more than 90 days in Thailand though, you will need to look into getting a proper Tourist visa at a Thai consulate or embassy.
If you're travelling on a Malaysian passport, you're still eligible for the 30-day visa waiver if you arrive by land.
A typical tourist visa for Thailand is valid for 60-days, is single-entry and generally requires one photo and an onwards ticket, although in practise the latter is often not asked for. Multiple (two) entry tourist visas are available at some Thai consulates and embassies. Cost and processing time varies depending on the embassy or consulate issuing the visa.
Thailand's visa waiver programme is sometimes referred to as a visa on arrival, but officially it is known as a visa waiver. If your country is not listed below you are required to get a visa beforehand at a Thai consulate or embassy or perhaps apply for a visa on arrival (depending on your nationality).
In May 2014, a change was made whereby at the discretion of the immigration officer, people doing back to back visa runs by land (the rule extends to air arrivals in August 2014) may be refused entry to Thailand. There has been no clear guidance given regarding how long one needs to be out of Thailand before they can re-enter on another visa waiver. While it is understood the rule change is aimed at serial overstayers who are living in Thailand illegally rather than bona fide tourists, the vague nature of the rule is frustrating.
The following 7 countries (G7 members) are eligible for a visa waiver of 30-days regardless if by arriving by land or air.
United States of America
The 38 countries eligible for a visa waiver (30-days if arrive by air, 15-days at a land crossing) are:
United Arab Emirates
The nationalities of the following three countries are eligible for a 90-day visa waiver
For more information
Visa on arrival
28 nationalities can apply for a 15-day visa on arrival, for an application fee of 1,000 baht (one photo required). These are:
Federal Democratic Republic of Ethiopia
For more information
Extensions are possible for the 60-day tourist visa and can be organised at immigration offices within Thailand. Generally two extensions are possible, the first for 30 days and a second for 7 days. Each extension costs 1,900 baht. In both cases these are given at the discretion of the issuing officer.
Both the 15 day and 30 day visa-waiver can also be extended once, for 7 days. This extension also costs 1,900 baht. In practise, if you're relatively close to an international border it will probably be cheaper to do a border run and get another 15 days.
If you overstay your visa, expect to be charged 500 baht per day of overstay.