Haffajee, who headed the weekly newspaper from 2009, would leave her post at the end of July.
"My seven years with the company have been a joy and a life highlight," Haffajee said in a statement.
"I move on to writing again in fast, fresh and data-driven journalism."
She will be joining business news publisher Bloomberg as a writer in September.
Media24 said a successor would be announced in due course.
Before taking up the Bloomberg post, she would moderate at the Aspen Institute's action forum in July, and work on her next book proposal.
"City Press and Media24 have empowered and transformed me. I leave a large part of my heart at City Press and thank my colleagues for years of great joy and fun."
Read also: Tim Modise with City Press editor Ferial Haffajee – "I'm a critical patriot"
Media24 CEO Esmaré Weideman described Haffajee's resignation as "a huge loss".
"She is an extraordinary editor – brave, bold, fair, connected and in touch with her market. She was a fantastic brand ambassador for her newspaper and for Media24 as a company. We are very sad to see her go," Weideman said."Ferial indicated a few months ago already that she felt her work at City Press was done and that she wanted to go learn and do something new. We can only hope she will return at some stage."