The site is a collaboration between the Thai FDA, Narcotics Control, and Ministry of Public Health. Enter details, select name(s) of meds, get the answers. If any of them are, follow the instructions to apply for a permit to bring them into the country. Typically, you receive your permit in 2-3 days.
If you have a tourist visa, you can stay for 60 days or extend it for another 30 days. If you just arrive with your passport, you will receive a visa-exempt stamp that will allow you to stay for 60 days or extend the stamp for another 30 days.