Apart from a few officially endorsed activities, most notably the Thai lottery, gambling is illegal in Thailand. However, this is Thailand and gambling is as popular here as it is in many other countries. The fact that it is illegal just means there is usually a bit more discretion involved.
For the tourist visiting Thailand it means you have to be aware of the rules, because flouting them could lead to a big fine. If you are in a bar enjoying a few games of pool don’t pull out a 1,000 Baht note, slap it on the table and announce that you can beat anybody in the room. If you are on the overnight train from Bangkok to Chiang Mai enjoying a friendly game of cards, even betting a few coins on each hand could, in theory at least, get you into trouble. In both instances it’s unlikely that you’ll run into problems, but it only takes one Thai person to take a dislike to what you’re doing and you may find the Thai police lecturing you about the error of your ways and issuing you with an instant fine. The fact that the policeman issuing you with the fine may have himself just lost 2,000 Baht from betting on English football results is neither here nor there. It’s just another one of Thailand’s contradictions.