Apply for a tourist visa through the evisa system before you travel to Thailand.
****************************
With a tourist visa I'll receive 60 days when you arrive and you can apply one time at an immigration office for a 30 day extension, giving you 90 days total.
Please check with your airline as they may not let you board your flight without proof that you'll be leaving Thailand within 60 days since that's all the time your visa would provide you upon arriving to Thailand.