Beach on Ko Tao
Thailand is largely tropical, so it's hot and humid all year around with temperatures in the 28-35°C range (82-95°F), a degree of relief provided only in the mountains in the far north of Thailand. The careful observer will, however, note three seasons:
Cool: From November to the end of February, it doesn't rain much and temperatures are at their lowest, although you will barely notice the difference in the south and will only need to pack a sweater if hiking in the northern mountains, where temperatures can fall as low as 5°C. This is the most popular time to visit and, especially around Christmas and New Year's, finding flights and accommodation can be expensive and difficult.
Hot: From March to June, Thailand swelters in temperatures as high as 40°C (104°F). Pleasant enough when sitting on the beach with a drink in hand, but not the best time of year to go temple-tramping in Bangkok.
Rainy: From July to October, although it only really gets underway in September, tropical monsoons hit most of the country. This doesn't mean it rains non-stop, but when it does it pours and flooding is not uncommon.
There are local deviations to these general patterns. In particular, the south-east coast of Thailand (including Ko Samui) has the rains reversed, with the peak season being May-October and the rainy off season in November-February