As a foreigner, you are required by Thai Immigration Law to initially enter the Kingdom on a Visa if you wish to have a long-term stay in Thailand.
This can be a visa (tourist visa for 60 days or non-immigrant visa for 90 days) issued by a Thai Embassy or Consulate outside of Thailand. You can also obtain a temporary stay with under the Visa Exemption Rule (VER). This allows citizens of 41 countries* permission to enter the Kingdom for a limited period of time (up to 30 days depending on the nationality) in accordance with Thai Immigration Law. This is commonly referred to as a 30-day stamp.
Under the new provisions of the Visa Exemption Rule (VER), visitors can now come regularly to Thailand without limiting their stay within a total of 90 days in a six-month period. Just keep in mind that under the VER, you are allowed 30 days maximum on each visit.
The restriction has already been abolished so tourists can now visit Thailand as often as they want, provided that they obtain 30 day Visa on Arrival at airports and 15 day Visa on Arrival if they are traveling via land borders. Thai Immigration Laws are revised on a regular basis for the convenience of tourists. However, immigration officials still recommend getting visas prior to arrival in Thailand, as they remind visitors that back-to-back short visas are not the proper way to extend the stay in the country on a long-term basis.