The Spaniard has long been tipped to join the squad, which will see him leave Renault after just over a season with the French marque.
“We're incredibly excited to have Carlos join us as a McLaren driver,” said McLaren team boss Zak Brown.
“We've been assessing him for some time now and rate him very highly among the next generation of young talent emerging through the ranks in Formula 1.
“Carlos brings with him the perfect blend of youth and experience. Although he's just 23, he'll be starting his fifth season in the sport with us and will bring with him a huge amount of racing experience, both in Formula 1 and with our partner Renault.
“I'm delighted to finally be able to confirm that I'll be a McLaren driver from 2019,” added Sainz.
“It's something I've been looking at for a while and I'm very excited about this next chapter in my career.
“I've been a McLaren fan for as long as I can remember. It's a great name in the sport with an incredible heritage, and the list of drivers that have raced for McLaren over the years are among the heroes of Formula 1.
Sainz has been on loan to Renault since the United States Grand Prix last year, but has lost his drive with the French marque to Daniel Ricciardo for next season.
Further to his confirmation at McLaren, it's unlikely he will remain a Red Bull driver going forward, paving the way for Toro Rosso's Pierre Gasly to move into Daniel Ricciardo's current seat alongside Max Verstappen.
Sainz is the only confirmed McLaren driver for 2019, with Stoffel Vandoorne and development driver Lando Norris both linked with race drives.
A highly credentialed racer in his junior career, Vandoorne has endured a tough second season in F1, while McLaren earlier this year blocked a move from Red Bull to place Norris at Toro Rosso instead of Brendon Hartley.
McLaren currently sits seventh in the constructors' championship, among the thick of a tightly packed midfield battle that also includes Haas and Force India.