Mexico did not "lose" these territories in separate events; they were ceded collectively through the Mexican Cession (1848) following the Mexican–American War (1846–1848).
Mexico ceded ~55% of its pre-war territory to the U.S. for $15 million. The cession included:
Texas had already been annexed by the U.S. in 1845 (after declaring independence from Mexico in 1836), which was a primary cause of the war.
A later, separate purchase added ~29,670 sq mi of southern Arizona and southwestern New Mexico for a transcontinental railroad route.
Thus, Mexico lost control of Texas, New Mexico, and Arizona through the combined outcomes of the Texas Annexation, the Mexican–American War, and the Gadsden Purchase.