Your Mexican Visa can be extended if upon entering the country you were granted less than six months allowed time of stay.
The following is what you need to do and know if you want an extension of your Visa to remain in Mexico legally.
Mexican Visa
When entering Mexico as a tourist, you should have an FMM document from the Mexican Immigration Authorities. This gives you permission to stay in the country for a given time.
You can fill this document on the plane before handing them over before arrival or you can do this online.
When requesting for an extension, always use its official name, which is FMM( Forma Migratoria Multiple )
180 days is the maximum days of extension of your FMM, no more than that.
Visa extension
Visit the nearest Mexican Immigration offices.
Have a passport and your Visa with you, as well as cash, credit card or a traveler's cheque.
Fill a form, which you'll be given at the immigration office, take it to the bank for payment then return them.
Make sure you're time conscious. Offices are open from 9 am to 1 pm during workdays and closed during national holidays.
Upon expiration of the 180 days, you'll need to leave Mexico and acquire a new Visa.