Basically, we got California, New mexico, Arizona, parts of Oklahoma and Colorado by the Treaty of Gradalupe Hidalgo in 1848, for $15 million (and winning the war). We got the Southern part of Arizona by the Gadsden Purchase in 1853 for $10 Million.
See the full texts of the treaties, at this link:
http://www.yale.edu/lawweb/avalon/diplomacy/mexico/mxtreaty.htm
See Article XII of the 1848 treaty and Article III of the 1853 (notice that both sums were in part to paid over time!).
Incidentally, the "Avalon Project" linked to above is a fabulous site for the full text of an enormous amount of document from throughout American History.
Thank you.