The 53-year-old will depart the Gunners by the end of October, and take up his new role in Italy on December 1.
Gazidis will be replaced by head of football relations Raul Sanllehi and chief commercial officer Vinai Venkatesham, who become head of football and managing director respectively.
In a message to Arsenal supporters, Gazidis said: “For the last 10 years I have been privileged to dedicate myself to this great club.
“Arsenal is entering a new chapter and I have done everything I can to ensure that it is strongly placed to take on that challenge.
“I know many will think this is a strange time to be leaving but I believe it is the right time for me and for the club. Change and succession is not only inevitable for a club like Arsenal, it is necessary if it is continually to keep moving forward.
“Although it is very hard to do – the hardest decision of my life – I believe that, after 10 years, it is the right time for me to step aside to allow new leadership, energy and ideas to take the club forward into this exciting new era.
“I am excited to see what the future holds for this great club and I am energised by a new personal challenge with AC Milan. I am now looking forward to joining one of the world’s other great clubs, and working to restore it to its rightful place in football.”
Sanllehi, who joined Arsenal in February, was previously director of football at Barcelona, while Venkatesham worked on the London 2012 Olympics.
Josh Kroenke, deputy chairman and son of owner Stan, said: “It has been a pleasure working with Ivan. We will miss the wisdom, insight, and energy he brought to our club on a daily basis over the past decade.
“We are confident we have outstanding people in Raul and Vinai, and we look forward to working with them and coach Unai Emery to continue to move the club forward on and off the pitch.”