As told above, go to your local immigration office to get the handout for an initial in-country Non-O visa based on being married to a Thai national. And also check with them how many minimum days they accept. Most offices require you to have at least 15 days remaining with your current stamp for you to apply for an in-country visa, but some offices require you to have 21 days or more. You need to apply for your visa before that date with meeting all requirements that are immigration office specific..
Here is the general requirement for in-country Non-O spouse to a Thai, may give you a rough idea of what you may need
************************************************************************************************************************************************
*******
/6.FOR-PROVIDING-SUPPORT-TO-OR-BEING-A-DEPENDANT-OF-A-THAI-CITIZEN-SPOUSE-VISA-NON-O.pdf