@Ta***
, there is no amount of time you need to be out of the country BUT be advised you could be questioned by passport control when entering visa exempt like that. According to the rules you can be asked to show proof of adequate funds (40K baht per family or 20K baht a person) proof of onward travel, and proof of a hotel booking.
As long as you don't have an extensive history of living here on back to back tourist visas or visa exempt entries it is unlikely you will be questioned (but you could, so at least have the proof of funds).