Mahrez spent five years at the Etihad Stadium after joining from Leicester City for £60m in the summer of 2018 and went on to win four Premier League titles, three League Cups, two FA Cups and the Champions League last season.
The 32-year-old made 236 appearances in total for Manchester City, scoring 78 goals and providing 59 assists.
The Algerian winger also won the Premier League while at Leicester City.
Mahrez holds the record for the most assists by an African in Premier League with 65.
"To play for Manchester City has been an honour and privilege," said Mahrez, who has signed a three-year contract for Al Ahli.
"I came to City to win trophies and enjoy my football and I achieved all that and so much more.
"I have had five unforgettable years with this football club, working with unbelievable players, fantastic supporters, and the best manager in the world.
"I've made a lifetime of wonderful memories and the manner of our Premier League title wins and the battles we've had with Liverpool and, last year, Arsenal, underlined our collective desire and mentality to be the best.
"Manchester City will forever be a huge and happy part of my life."
Al Ahli have former Liverpool striker Roberto Firmino and ex Chelsea goalkeeper Edouard Mendy on their books while they are on the verge of sealing a move for Newcastle United winger Allan Saint-Maximin.