Remember that the rules can change so check the links below

1. Tourist Visa Exemption (Visa Waiver Stamp)

If you are eligible (check THIS LINK to see which nationalities are) you can enter Thailand without a visa and receive a Visa Exempt stamp on arrival. If you arrive at an airport you will get 30 days. At land borders, citizens of the USA, UK, Canada, France, Germany, Italy, Japan, and Malaysia are allowed 30 days while all other nationalities only get 15 days. No payment is needed and the only form is the usual Arrival/Departure card that you will be given on the plane or at the border.

2. Visa on Arrival (not the same as above)

Some nationalities (check  THIS LINK to see which ones) can take advantage of the Visa on Arrival system; you will need to pay a fee and fill out a form before reaching Immigration. There are clear signs in the airport showing you where to go to complete the form. Search the Thailand forum for current details on fees and requirements.

3. Tourist Visa

If you are not eligible for either of the above, or you wish to stay longer than 30 days, you can apply to your local Thai Embassy or Consulate for a Tourist Visa, which is normally valid for 60 days; multiple-entry visas for one, two or three entries are allowed, which allow even longer stays. You will need to complete an application form with photographs in advance, and pay a fee.

 Notes: 1) From August 2014 Visa Exempt entries and Tourist Visas can be extended once for each entry, for a period not exceeding 30 days. This requires formal application and payment of the extension fee, currently 1900 baht, at any Immigration Office. This must be done on or before the current period of stay expires. 2) Please note that applications for extensions are not automatic and are at the sole discretion of the Immigration Officer and  may require documentation to support the application. 3) The application fee is not refundable in the case of a rejection/refusal. 4) The full application fee is payable irrespective of the actual period of extension if less than the maximum 30 days. 

Update October 2014:

Thailand offers many visas. You can read about them at the Thai consul website in Washington, DC. These visa guidelines should be the same worldwide.

See: http://www.thaiembdc.org/dcdp/?q=Visa

Note:

Be cautious about heeding the advice of posters on all sites talking about "border runs" and other "work around" solutions to get a visa. A lot of these folks are transient workers or those who otherwise do not qualify to be in Thailand under the correct visas. Or, they simply do not wish to be bothered with pursuing the correct visa. Follow the rules at the website above and you should not have any problem visiting and staying in Thailand.

The NCPO (coup leaders) are implementing and enforcing new and existing visa rules. News stories about these changes are published daily. If you stay current with the news and follow the rules you should have no problems getting a visa for Thailand.

Note 2:

Knowledgable Thai sources report some vendors offering Thai visa services will charge you a fee to "process, gain, and update" the correct visa for you. Be cautious. Some of these operators exploit previous vulnerabilities in the system by creating their own look-alike stamps and entering them into your passport. They never send your passport to the authorities for processing. Use caution when selecting a third party handler.

Note 3:

LOOK at the stamps in your passport after Thai officials enter them. Trainees are known to make mistakes. For example, if you have a multiple entry visa, a trainee might mistakenly stamp a single entry stamp into your passport. This could cause you problems later.