The 20-year-old right-back has penned a contract until June 30, 2017 after the Bundesliga club agreed an undisclosed fee with the Spanish champions.
"This transfer has ensured we are in a perfect situation for the future in terms of the important position of right-back," said Bayer managing director Wolfgang Holzhauser
"Daniel Carvajal is already a great player and has huge potential given his age. He is definitely a top quality signing for us."
Bayer sporting director Rudi Voller hailed the signing as a perfect fit for the club.
"Daniel Carvajal completely suits our style of play," he said.
"He's an outstanding player, has great quality going forward and will continue to develop with us."
Carvajal came through the youth ranks at the Bernabeu, joining the club in 2002 and eventually stepping up to Madrid's reserve team in 2010.
He was a key member of the Real Madrid Castilla team that won promotion to the Segunda Division last season, and was also part of Spain Under-19s' European Championship-winning side in 2011.