If you want to save some time and print our your immigration permit (FMM Online) ahead of time, the Mexican Immigration office has a fillable online FMM form here:
If you are traveling beyond the “tourist zones” for more than 72 hours, the Mexican Immigration office requires you to purchase this FMM or “Tourist Permit”. The estimated cost is 500 MXN Pesos. (about US$27 as of 6/30/17)
As an alternative, you can purchase a paper FMM at immigration when you cross the border, and pay for it at the Banorte/Banamex next door.