Mexican Perez, 22, joins 2009 champion Jenson Button.
McLaren team principal Martin Whitmarsh stated: “[Perez's] performances throughout 2012 have convinced us that he's an extremely exciting prospect for the future.
"It was a string of giant-killing performances, a trio of podiums and a brilliant fastest lap in this year’s Monaco Grand Prix that showed us that Sergio lacks nothing in terms of speed and commitment. We've been monitoring his progress carefully for some months.
"He's perfectly poised to develop into a world championship challenger. His addition to the Vodafone McLaren Mercedes team provides us with the perfect two-pronged driver line-up for the new season.
"Finally, it's entirely appropriate that I should take this opportunity to pass on our thanks to Lewis [Hamilton]. He wrote a huge chapter of his life and career with us, and was, and always will be, a fine member of an exclusive club: the McLaren world champions' club.
"It goes without saying that we all wish him well for the future, just as it also goes without saying that we hope and believe that Sergio, too, will become a member of that exclusive club before too long."
Perez said: "I’m thrilled and delighted to have become a Vodafone McLaren Mercedes driver. The McLaren name is one of the greatest in the history of Formula 1.
"For more than 40 years McLaren has been a team that every racing driver has aspired to drive for – I was brought up on the great stories of Ayrton Senna's many world championship triumphs for McLaren – and I'm truly honoured that they've chosen me to partner Jenson from 2013 onwards."
Hamilton has signed a three-year deal with Mercedes. That means Michael Schumacher, the sport's most successful driver, will leave the Silver Arrows. His future is now uncertain.
- McLaren team