He replaces fellow Argentinian Gerardo Martino, who left after failing to lead the side past the group stage in Qatar last year.
"We're convinced that it was a good decision and that we're going to triumph with Diego at the helm," said Rodrigo Ares de Parga, an executive director at the Mexican Football Federation.
"He's a hard worker and a great strategist," Ares de Parga told a news conference, adding that five candidates had been interviewed for the job.
Cocca, who turns 51 on Saturday, is the Mexican national team's 45th coach and its fifth Argentine manager.
He previously led the Mexican club Tigres, which announced this week that it had terminated Cocca's contract after only five games in charge due to his move to the national team.
He will be tasked with ensuring the side put on a better performance in the 2026 World Cup, which Mexico will jointly host with the United States and Canada.
Martino, his predecessor, was appointed in 2019 with the goal of leading Mexico to the quarter-finals for the first time in more than three decades.
Instead, the team suffered an agonizing exit in the group stage in Qatar -- a result that Martino rued as a "huge failure."
It marked Mexico's earliest exit from a World Cup finals since the team failed to go past the group stage in 1978.
(For more sports news and updates, follow Ahram Online Sports on Twitter at @AO_Sports and on Facebook at AhramOnlineSports.)