The 1848 Treaty of Guadalupe-Hidalgo established the Rio Grande as the border between Texas (as part of US) and Mexico. Also, a large amount of territory was ceded to the US by Mexico, in exchange for a compensation payment of $15 million.
When the USA annexed Texas as a state in 1845, the border between the US and Mexico became a matter of dispute and, ultimately, a cause for war. Mexico claimed that the border between Texas (as part of US) and Mexico was the Nueces River. The United States, on the other hand, said the border was the Rio Grande, further south than the Nueces.
When the war ended with the US victorious, the Treaty of Guadalupe-Hidalgo assigned the Rio Grand as the border, from its mouth at the Gulf of Mexico to the point where it reached New Mexico. (From there the border was assigned according to geographic lines on maps.)
As far as the $15 million payment from the US to Mexico in compensation for the large amounts of territory taken over by the US -- $15 million in 1848 would equal about $420 million in today's dollars. So that was a significant amount of money.
The Mexican Cession was territory ceded (meaning given up) to the United States in 1848 after the Mexican-American War. The territory included lands that represent the full states of California, Nevada, and Utah, as well as large portions of Arizona and New Mexico, and about a quarter of what would become the state of Colorado. There was also a small section of Wyoming involved. That represents the bulk of territory that is in Southwest of the present United States.
The terms of the treaty were:
*To add 525,000 square miles to United States territory. It included Arizona, California, Colorado, Nevada, New Mexico, Utah and Wyoming.
*Mexico also abandoned all requests to Texas and declared the Rio Grande as America’s southern frontier.
* The United States paid Mexico $15 million.
* The United States agreed to settle the reclamations of its citizens against Mexico.