Raul, who scored 323 times in 741 games for Real, notched 66 Champions League goals and is Spain's all-time leading scorer with 44 goals, will try to revive his career in the industrial city of Gelsenkirchen after falling out of favour at the club where he made his name
"This is a great piece of news for Schalke 04," coach Felix Magath told the club's website.
"I'm happy that we've succeeded in inspiring such an outstanding footballer and world class player into changing to the Bundesliga and to Schalke," he added.
Schalke finished as runners-up to Bayern Munich in the Bundesliga last season, qualifying directly for this year's Champions League group stage.
Raul barely featured at Real under Manuel Pellegrini last season and the club have further strengthened the squad for the arrival of new coach Jose Mourinho.
The club said he would sign a two-year contract, assuming he passed a medical.