The 33-year-old joined the club in the summer of 2008 and has made 360 appearances.
He signed off with victory in the FA Cup final on Saturday, where City thrashed Watford 6-0 to complete a domestic treble.
Kompany said: “As overwhelming as it is, the time has come for me to go. And what a season to bow out.
“I feel nothing but gratefulness. I am grateful to all those who supported me on a special journey, at a very special club.”