The Verdict: Need More Info
Studying has its own residence, and it turns on securing a place. Get the institution's acceptance letter, then apply at the Mexican consulate for your country.
Student residence lasts for the course and is renewed each year against a letter from the institution.
At higher, postgraduate or research level you can be allowed to work, with a letter of conformity from the institution and a job offer related to your field of study.
Staying on to work after the course means a work-authorised residence through an employer registered with the immigration institute (INM), so start checking employers before your final year.