The 20-year-old joined Los Blancos from Real Zaragoza in 2015, but has not yet represented the Madrid giants after spending his short Bernabeu career out on loan.
The Spain Under-21 international impressed during a loan spell with German side Eintracht Frankfurt during the 2016-17 season, however, and as a result, will return to the Bernabeu ahead of the new campaign.
"It was my dream when I signed for Real Madrid two years ago to be part of the first team. This dream has now come true," Vallejo told Frankfurt's official website. "But it would never have been possible without the help of Eintracht Frankfurt."