You can apply during the last 30 days of your stay, but be aware if your application is denied, the stamp will be not approved and 7 days from application day to leave the country.
You can apply for a conversion from your tourist visa into a Non Immigrant O visa but it takes at least 15 days under consideration. If the visa is approved you have to wait 60 days to apply for the 1 year Extension of Stay, it can not be done all at the same day.