"This is an excellent time to hand the reins to our next CEO, who will take the group through to our bicentennial celebrations and beyond."
IG market strategist Evan Lucas said Kelly had been a standout chief executive who had driven the bank's share price to record highs.
"She has been nothing short of an excellent CEO," he said.
"She oversaw the largest merger and acquisition in Australian banking history with the St George/Westpac merger and since then she has overseen a massive return in value with regards to the share price."
But he said her departure would leave Australia without a female chief executive among its top 20 listed companies.
"The sad part about this is that she is probably not only the most successful but the most prominent female CEO and her stepping down is a big loss," he said.
Lucas also said while Westpac has performed very well under Kelly, Hartzer was likely to face some difficult headwinds during the next two years.
"She has left the bank in pretty good nick but she is probably leaving at a time when things could get a little bit rocky," Mr Lucas said.
He said home lending, which has grown strongly in the past two years was likely to slow at some point and Westpac would face strong competition in its wealth management business.
Hartzer will also have to deal with the fallout from the federal government's financial services inquiry, which is due to hand down its final report later this month.
Westpac chairman Lindsay Maxsted praised Ms Kelly's leadership of the bank during the global financial crisis and the St George merger.
And he said Kelly's tenure had resulted in a more diverse workforce.
"Gail's passion for people has resulted in the development of a diverse and highly engaged workforce," he said.
"She has personally driven the growth of women in senior executive roles, mature aged workers and those who work part-time."
Kelly, who has four children including triplets, has not indicated what her future plans are.
She was named as the 56th most powerful woman in the world by Forbes magazine earlier this year.
-AAP