The 63-year-old joined the RFU in 2012 and oversaw a Six Nations Grand Slam and successive titles for the men's team and a World Cup title in 2014 for the women's team.
"Rugby is a special sport, and one which is very hard to leave," said Ritchie.
The RFU intend to have a replacement by the end of the summer.
"It has been an honour and a privilege to lead the RFU," added Ritchie, who headed the All England Club prior to his RFU role.
"I'm proud to have been part of the rugby family, working with so many talented, passionate and committed teams at every level of the game and of the union."
The head of Premiership Rugby says the departing Ritchie has "contributed massively" to club and country relations.
"He's always someone we felt we could do business with," Mark McCafferty told BBC Radio 5 live.
"He's contributed massively to finding a good balance between club and country.
"We haven't always seen eye to eye, but there has always been a good amount of give and take, which is the way the English system has to work."
BBC sports editor Dan Roan
Ian Ritchie restored authority and order at the RFU after a damaging and turbulent period following England's dismal 2011 World Cup campaign. His tenure was not without disappointments however.
In 2015, after the ignominy of England's group-stage exit from their own World Cup, he faced calls to resign.
After all, despite no rugby background, he had hired Stuart Lancaster as head coach, handed him a six-year contract extension in 2014, and said he would take responsibility if the team failed. It was Lancaster however who lost his job.
Ritchie, (who was awarded a pay-rise to £700,000 per year), had to get his next big decision right, and the appointment of Eddie Jones has been fully vindicated.
Thanks in part to hosting the sport's showpiece event in 2015, the RFU has also become the country's richest sport's governing body under Ritchie's leadership, enabling it to invest more in the grassroots and grow participation, while he also led delicate and crucial negotiations with the top clubs.
Rugby Football Union's chief executive Ian Ritchie has announced he will retire at the end of the summer.