Have you already went to the immigration office and gotten a 30 day extension on the current 30 day visa exempt entry stamp you have?
There is no amount of time you have to be out of the country. BUT be prepared to be asked for proof of funds 20K baht (or the equivalent) in CASH when you fly back in and possibly proof of onward travel in 30 days.
At the thai consulate in Phnom Penh you're going to need proof of 1000USD baht in a bank account (cannot be cash) and proof of onward travel in 60 days. Plus the thai consulate in Phnom Penh takes 3 days to issue visas. Even agents who push paper there can't break that timeline.
*****************************************************************************
*****
**********
-Tourist-Visa.html