The agreement comes less than two weeks after Alford agreed to a 10-year contract with the Lobos.
Alford led New Mexico to a 29-6 record this season that included the Mountain West regular-season and tournament titles. But the Lobos were upset by Harvard in the second round of the NCAA tournament shortly after Alford's new deal with the school had been announced.
New Mexico has won 155 games under Alford, who is replacing Ben Howland, who was fired last week after 10 years at UCLA.
UCLA athletic director Dan Guerrero called Alford a "perfect fit for UCLA," because he connects with a new generation of players and brings an up-tempo and team-oriented style of play to Westwood.
Alford, whose hiring was announced Saturday, agreed to a seven-year deal worth $18.2 million, with a yearly salary of $2.6 million and a $200,000 signing bonus. He will be introduced at UCLA on Tuesday.
The Associated Press contributed to this report.