A number of clubs have been linked with a loan move for Hakimi, who scored twice in 17 first-team appearances for his Spanish club during the 2017-18 campaign.
Lopetegui agreed to take the Madrid position days before the 2018 World Cup, and Hakimi, who represented Morocco in Russia, has said that he will soon hold discussions with his new manager.
"Lopetegui and whether I'll stay at Madrid? It caught us by surprise, not only myself but I think all you guys too," Hakimi told reporters.
"I have to go back to Madrid and talk to him. I want to stay, they're the club of my life and I'm happy, but we'll see what happens. I'll talk to the coach and see what's best for me."
Right-back Hakimi joined Madrid's youth system at the age of eight.