If you are not Mexican and have no other valid migratory form in Mexico (e.g., temporary or permanent residency), in order to enter the country you need to have a tourist/business visitor/visitor in transit migratory form (FMM). In accordance with international immigration treaties between Mexico and other countries, the procedure to obtain the FMM varies with the nationality of each visitor. This form can be obtained for each person at the first port of entry, the Mexican borders or on-line: https://www.inm.gob.mx/fmme/publico/solicitud.html.
You are advised to request migratory and visa requirements information at any of the Mexican Embassies or Consulates far enough in advance before planning your travel, as additional to the FMM you might need a visa to enter Mexico and in some cases its processing time can take up to 30 working days. Although your travel agency can inform you about visa application procedures and resolution times, you are recommended to confirm them with the Mexican Embassy or Consulate nearest to your domicile.
When you enter and leave Mexico, make sure that your migratory form is stamped and authorized by the migratory authority. If you decide to prolong your stay for a period longer than that granted by your permit (FMM), before expiring it you must request its extension before the migratory authorities. Including extensions, the FMM maximum period validity is six months as tourist and business visitor, and 30 days as visitor in transit. Extensions and changes of migratory status are possible provided that these procedures are not stated as restrictions on the FMM.