The 17-year-old made his debut last November and has scored five goals in nine league appearances for the club in the Brazilian top flight.
Los Blancos have stated that Goes will make the switch to the Bernabeu in July 2019, with his 18th birthday falling several months earlier on January 9.
"Real Madrid FC and Santos Futebol Clube have agreed that Rodrygo Goes will play his football at Real Madrid when he reaches the legal age requirement," the La Liga side said on their official website.
"Although the player would be able to play for our club as of January 2019, the agreement in place sets out that he will join the squad in July of that year."
The transfer fee has not been confirmed but media reports have claimed that the Champions League winners have paid in the region of £39.5m for Goes.