She will also step down from the board and from her role as a director.
Phil Bentley will succeed McGregor-Smith as chief executive of the strategic outsourcing company.
He will join as a director of Mitie at the beginning of November, and assume the position of chief executive when McGregor-Smith leaves the company in December.
The pair will work closely together to ensure an effective transition including with clients, employees, investors and other stakeholders as required.
McGregor-Smith, who trained to be an accountant at BDO from 1985 to 1991, has been a director of Mitie since December 2002 and has served as chief executive since April 2007. She said it was a “real honour to serve on the board of Mitie and in particular to hold the role of chief executive".
“I am delighted that we are now in a position to appoint a new chief executive for Mitie and I wish Phil a successful future with the group,” she added.
Bentley brings a wide range of executive and leadership experience from across industry, including most recently at Cable and Wireless Communications, where he served as group chief executive officer, until its acquisition by John Malone's Liberty Global.
He previously ran British Gas for seven years. Prior to that, he held a range of senior management and finance roles at Centrica and Diageo.
Roger Matthews, chairman of Mitie said, "I would like to thank Ruby for the very significant contribution she has made to Mitie over the past 14 years. Since becoming CEO, she has doubled revenue and profits, built a market-leading UK facilities management business, and been an inspiration to Mitie's employees. I wish her every success for the future.
"I am delighted that Phil Bentley is joining Mitie. He has proven CEO experience with an excellent track record of significantly enhancing shareholder value in services businesses. I welcome him to the group and I am looking forward to working with him."
Bentley added, "Ruby has done a brilliant job building Mitie into the admired industry leader it is today. Although it is a challenging time for the sector, we have a strong platform from which I am certain we can now prosper.
"I am really looking forward to working with my new colleagues, delivering world-class services to our customers and creating sustainable shareholder value."
McGregor-Smith won the 2015 ICAEW Outstanding Achievement award for her exceptional contribution to business and diversity initiatives.