Hamilton has been at McLaren throughout his F1 career but the British team had been unwilling to match a lucrative offer from Mercedes, where he will team up with Nico Rosberg next season on a three-year contract.
The deal, which had been rumoured for weeks, was confirmed by Mercedes on Friday shortly after McLaren announced its signing of Perez.
"It is now time for me to take on a fresh challenge and I am very excited to begin a new chapter," Hamilton said. "Mercedes-Benz has such an incredible heritage in motorsport, along with a passion for winning which I share.
"Together, we can grow and rise to this new challenge," the 27-year-old Hamilton added. "I believe that I can help steer the Silver Arrows to the top and achieve our joint ambitions of winning the world championships."
Hamilton won his only F1 title with McLaren in 2008, but the past two seasons have featured a mixture of brilliant driving, clashes with other drivers and controversial moments.
Hamilton angered team management by posting a photo of a telemetry sheet showing data from his and teammate Jenson Button's car on his Twitter page at the Belgian GP recently. Button publicly criticized Hamilton for the incident, increasing speculation that a change was imminent.
The 43-year-old Schumacher has struggled for consistency since coming out of retirement in 2010 to join Mercedes. Now in his third season with Mercedes, the German has managed only one podium finish — third place — during that time. This season, he has retired from seven races.
"I have had three nice years with the team which, unfortunately, did not go as well as we all would have wanted on the sporting side," Schumacher said. "I wish Lewis well and for the team to achieve the success we worked so hard for in the build-up. I would like to thank the team for their trust and all the guys for their unconditional commitment."
Team chief Ross Brawn thanked Schumacher "for the important contribution he has made to the growth of our team over the past three seasons" and sad he is excited about challenging for the title with Hamilton.
"The arrival of a driver of Lewis' calibre is a testament to the standing of Mercedes-Benz in Formula One and I am proud that Lewis shares our vision and ambition," Brawn said. "I believe that the combination of Lewis and Nico will be the most dynamic and exciting pairing on the grid next year, and I am looking forward to what we can achieve together."
Perez, meanwhile, signed a "multi-year deal" with McLaren after an impressive 2012 campaign that initially sparked interest from Ferrari.
"I'm thrilled and delighted to have become a Vodafone McLaren Mercedes driver," he said. "The McLaren name is one of the greatest in the history of Formula One," Perez said. "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 (Button)."
The 22-year-old Perez was part of Ferrari's young driver program and was at one stage expected to replace Felipe Massa.
Perez has finished on the podium three times this season, and his performance at the Italian GP in Monza this month, where he finished second to Hamilton, was hailed as one of the most impressive drives of his young career and a sign that he could be a genuine contender for race wins in a faster car.
"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," McLaren team principal Martin Whitmarsh said. "We've been monitoring his progress carefully for some months and, now that he's become part of the Vodafone McLaren Mercedes team, our task will be to refine and develop his abilities as his career progresses over the coming years."
Perez survived a heavy crash at last year's Monaco GP and started the new season strongly, with a second-place finish at the Malaysian GP in Sepang before securing third place at the Canadian GP in Montreal.
He is ninth in the overall standings ahead heading into next week's Japanese GP.
"I'm under no illusion that it is indeed a very big step, as it would be for any driver, but I'm ready for it," Perez said. "I'm already massively looking forward to working with everyone at Vodafone McLaren Mercedes, and with Jenson, who's someone I've long admired as a brilliant driver and a great champion."
Whitmarsh is confident he has a future title contender on board.
"He's perfectly poised to develop into a world championship challenger," Whitmarsh said. "His addition to the Vodafone McLaren Mercedes team provides us with the perfect two-pronged driver lineup for the new season."Suggest a correction