The Centre-back will stick with the Molineux Stadium outfit for the 2019/20 season with both sides refusing to disclose whether an option to buy was included in the deal.
Failing to glitter at club side, Vallejo was an integral figure in Spain’s Under-21 squad, having captained the side to European Under-21 Championship glory in June.
The 22-year-old defender becomes Wolves’ first summer signing as they look to be active in the transfer market ahead of a new season.
Having won 2-0 in their Europa League qualifier against Crusaders, Wolves boss, Nuno Espirito Santo could feature the new recruit in the reverse fixture in Northern Ireland on Thursday.
With his spell at Madrid witnessing a lot of injuries, the young defender managed to make just five LaLiga appearances for the Los Blancos, scoring one goal in last season.
Wolves, who look to augment their side to compete for European glory this time around have been linked with Patrick Cutrone of AC Milan for a reported fee of £22.5 million.
Vallejo joined Real Madrid in 2015 from Real Zaragoza for a fee said to be in the region of €6 million, signing a six-year contract with the White Angles as he was loaned back to Zaragoza for a year.