Michael Gustafson, who served as hospital president for five years, is leaving UMass Memorial Medical Center in July.