Pepe, 33, has enjoyed an impressive year for both club and country, helping Real to an 11th European crown in May, before playing a major role in Portugal's victory at Euro 2016 during the summer.
The former Porto defender has been with Los Blancos since the summer of 2007, but he has now confirmed that he wants to commit his future to the club and end his career with Zinedine Zidane's side.
"My plan is to retire at Real Madrid," he said. I'm 33 years old, and last season was one of my best ever. It will be what the club wants."
Pepe's current deal is due to expire at the end of the current campaign, but he insists it will be ultimately up to the club if they want to keep him beyond the end of the season.
He added: "My renewal is in Real's hands. I will wait for the club until the last second of my contract."
The experienced centre-back has made nine appearances for Real in all competitions so far this season, scoring his only goal of the campaign to date during the 5-2 victory over Osasuna in September.