Zidane told a news conference that "everything changes" and "that's why I took this decision".
He leaves having guided the Spanish club to three successive Champions League titles and one La Liga success since taking over in January 2016.
"I love this club," he added.
"What I think is that this team needs to continue winning but I think it needs a change, a different voice, another methodology. And that's why I took this decision."
Zidane, 45, took over after Rafael Benitez was sacked and was in charge for 149 games. He steered Real to 104 wins and 29 draws, had 69.8% win rate, and won nine trophies.
He said in February that he would walk away if he felt "there is nothing more to give".
However, the timing of his announcement still came as a shock just days after Real beat Liverpool 3-1 in the Champions League final.
"This is a club that has won 13 European Cups, so I'm happy to be part of this history," he said after victory in Kiev.
"We are going to think about what we achieved, enjoy the moment first. This is the most important thing now."