"Wolfsburg are a big name in German football and in the Bundesliga," Mayoral said on Real's official website. "I'm very happy and excited about the new chapter which lies ahead.
"I've had nine unforgettable seasons at Real Madrid and right now I'm feeling a lot of emotions.
"I've played for the best club in the world, something that very few players get the chance to do.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
"I'm eternally grateful to Real Madrid and to all of my teammates and coaches."
A youth product of Real, Mayoral, an under-21 Spain player, is hoping to follow the footsteps of 23-year-old forward Alvaro Morata.
Real bought back Morata last month for a pre-determined fee as part of the deal which saw the Spain international join Italian champions Juventus two years ago.
"I'm going to be gaining experience and will be looking to perform as well as I can to come back here," Mayoral said.
"Morata's case was similar to mine, he left and now he is back. "If he achieved it (return to Real), I believe I can too."
(Reporting by Adriana Garcia; editing by Amlan Chakraborty)
