Thomas Muller will leave Bayern Munich after 25 years at the Bundesliga giants when his contract expires this summer.