If you overstay for a short period you will have to pay a fine. However, if you overstay for more than 90 days then it is a serious offence and the result will be you are deported from Thailand and banned from visiting again. The length of the ban depends on how long you have overstayed your visa.