Mr. Zhang had previously served as Taobao's chief financial officer, president of Tmall.com and as Alibaba's chief operating officer before succeeding Jonathan Lu as chief executive.
Mr Ma said recently in an interview with Bloomberg that "there's a lot of things I can learn from Bill Gates", who also founded his own philanthropic foundation before stepping down as chief executive of Microsoft.
Born to a poor family in the eastern Chinese city of Hangzhou, Mr Ma began his career as an English teacher before becoming a self-made dotcom billionaire.
Ma, who also founded the company, will will complete his current term as a member of Alibaba Group's board of directors until 2020, the company said.
He is also known for his eccentric personality and has donned wigs and costumes to perform highly choreographed pop routines at company events.
After he steps down, he will continue to mentor management as part of the "Alibaba Partnership", a 36-member group of core company managers. His retirement as executive chairman will coincide with his 55th birthday.
Since handing over the CEO role, Ma has concentrated on philanthropy and promoting Alibaba internationally at business and political events. It was then backed by $60,000 from 18 co-founders. Three years later, the foundation for education pledged to donate $30m to a 10-year initiative to support teaching in rural China.
"This transition demonstrates that Alibaba has stepped into the next level of corporate governance from a company that relies on individuals, to one built on systems of organisational excellence and a culture of consistent talent development", Mr. Ma said in his letter.
Alibaba maintained robust revenue growth in the first half of 2018, but its profit margins have been squeezed by big-ticket investments as it battles to maintain pole position in payments and e-commerce.