Disclaimer : The comments here are written by a layman, not a lawyer, or someone qualified to know everything there is to know about immigration rules and visas. The best to get the full information is a visit to an immigration office (there is an information desk, and there are leaflets with rules and information), or a Thai embassy outside the country.
Most visitors coming to holiday in Thailand need not worry too much about visa issues. Except for some countries, there is no problem coming to the Kingdom of Thailand. You can stay without a visa for 30 days, so that would cover most holidays. You can also get a 15- day extension by going to an immigration office, while in the country.
Staying for longer periods, would involve visiting an embassy outside the country, and applying for a visa. That way you can get a tourist visa (you can stay in the country for 60 days, with a 30 day extension possible while in the country)
If your visit has another purpose than just being a tourist, you would need to apply for a so called non-immigrant visa, which covers many categories such as : working in the Kingdom, being a student, becoming a monk, etc. A basic non-immigrant visa would allow you to stay in Thailand for 90 days, which can usually be extended for up to 90 days while you are in the country. While visiting an embassy (not necessarily in your country of origin), you would also need to submit the relevant documents, like a work permit if you are going to work in the country, a letter from the institution where you are a student etc.
We have been a student in Thai language for a while. If you are a long-time student, you could also, while in the country, and with support of your institution of learning, apply for a 1-year education (non-immigrant) visa. This is usually granted only one time.
We have no experience with working in the country, or applying for a visa for such purposes. However, we strongly argue against getting a job in the country without permission. This can get yo into serious trouble when caught. Furthermore, people who break the law this way, are creating problems for all of us, who stay legally, and follow the rules.
One of our editors has recently applied for a 'retirement' visa. In our experience, this is easily granted if you just follow the rules. Requirements are as follows : you need to be 50 years old. Furthermore, you need to prove you have the necessary funds to stay in the country. The easiest requirement is that you have 800,000 baht deposited in a Thai bank. You can get a statement from your bank, and need to make copies of your current account or savings account booklet. The money needs to be in your account at least 3 months prior to your application.
The other way, is to prove that you have 65,000 baht coming monthly to the country (pension or likewise). This looks more cumbersome, and you would need to have some letters attesting to this transfer. Likely, your embassy in Thailand, will also have to support this fact.
If you have the age, the medical statement, and the prove of funding, you can head to the immigration office, and get your retirement visa the same day. It is valid for one year. If you want to travel outside the country during this period, you would need to go to immigration and get a exit/reentry visa. You will also have to show up at immigration every 90 days, and confirm your address. (Getting an entry stamp when entering the country, counts as a visit to immigration, of course, count 90 days from that entry date)
General comments : The rules for visas and at immigration, are rather complicated and difficult to grasp as an outsider. It needs some experience starting to know all the different ways of doing things. The law always stays the same. However, one sometimes gets the impression that there is a lot of room for interpretation. Besided law issues, the immigration officers are sometimes guided by how they feel on a particular day. This also applies for personnel staffing some embassies outside the country. Thai people of course, are more goodnatured than most, so 80-90% of the time there will be no problem regarding this issue. It certainly helps to be always respectful, polite, and suitably dressed, when interacting with immigration officials. However, the occasional unexpected problem can not be avoided altogether. One of us once had to wait after giving the money for his visa (1,900 baht for most visas at present), for more than one hour, before they gave him his change, and the receipt, and could proceed further. Most likely this occurred for something inappropriate he had said or done, though he was not aware of what it might have been at the time.