You can apply for a one year extension of stay based upon being married to a Thai at immigration. You will need 400k baht in a Thai Bank in your name only for 2 months on the day you apply.
After the extension is approved you can apply for a multiple re-entry to keep the remainder of your extension valid when you enter the country.
You can also apply for a 60 day extension to visit your wife to get more time to have the money in the bank.