How fast did this happen? etc.
A lot later than most people would think. I don't have exact years and language demographics in my source, but according to Ostler's Empires of the World, the push for Spanish surprisingly started after independence.
The crown did want to push for Spanish, but no one on the ground had this incentive. Early missionaries considered the imposition of a new language to be counterproductive to their goal of saving souls, and instead began translating religious texts to native languages in the 1500s.
Independence on the surface seemed to be a time to push for a national identity of Mexico distinct from Spain and its imperial language. However, the leaders actually driving independence were mostly American-born Europeans (creoles), so they by and large had no ability to speak Nahautl, Mayan, etc. When Mexico became independent, the push for Spanish began with mass education efforts.