The 56-year-old has enjoyed great success since taking over in 2019, which included winning the UEFA Champions League, Bundesliga and DFB Pokal last season.
However, after Bayern's win over Wolfsburg on Saturday, Flick confirmed he had already informed the club and the players about his decision.
"I told the team today that I informed the club during the week after the game in Paris that I would like to terminate my contract at the end of the season," Flick told Sky Germany.
"It was important to me that the team heard it from me. I am very grateful that I was allowed to accompany the team."
With the win over Wolfsburg, the Bavarians opened seven-point lead at the summit with just five games left of the Bundesliga season.
While the team are out of the Champions League and DFB Pokal, Flick's side look likely to claim a ninth straight Bundesliga title to wrap up a successful but short stint in Munich.