The Sweden forward spent last season on loan with the Rossoneri from Barcelona before a permanent move was formalised this summer.
And he told Gazzetta dello Sport: "I realised that what really matters in life is happiness.
"I used to play for Barcelona, the world's best team, but was not happy. When you've had an experience as bad as that you understand what is really important.
"I'll only leave when the club does not want me any more."
Milan won last season's Serie A title and Ibrahimovic's hopes of further success this term were raised by a 2-1 Super Cup victory over city rival Inter.
Ibrahimovic, who cancelled out Wesley Sneijder's opener before Kevin-Prince Boateng won the game for Milan, said: "The victory in the Super Cup against Inter Milan was crucial to start this season well because it was not an easy game.
"Because of this success we will have more peace around the team."