Hartley has not played since December due to a troublesome knee problem and it is that injury that has ultimately ended his career.
The hooker made 97 appearances for England, captaining his country on 30 occasions, and is the nation's second-most capped player behind Jason Leonard.
Hartley made his international debut in 2008 and was named Eddie Jones' captain ahead of the 2016 Six Nations, when England won the Grand Slam.
England also won the Six Nations with Hartley as captain in 2017 but his injury meant he missed the recent Rugby World Cup, with Jones' side reaching last weekend's final before losing to South Africa.
"I am extremely proud of my journey, both with Saints and representing England, but now is the right time to hang up my playing boots," Hartley said in quotes published on Northampton's website.
"I have loved my journey in rugby. I came to England as a teenager hoping to get a few games of rugby and to see the world.
"I could have never predicted that one day I'd play 14 years for such a special club and go on to represent and captain England."
Hartley made 251 appearances for Northampton across 14 seasons and came on when Saints won the Premiership final against Saracens in 2014.
His career was littered with controversies, though, and he was named England captain in 2016 despite serving bans totalling 54 weeks for offences such as gouging, biting and striking.
"My career wasn't perfect, but I wouldn't have had it any other way," Hartley added.
"I'm privileged to have experienced some amazing highs while there have also been some personal lows, all of which are powerful experiences that will stay with me forever.
"The final chapter of my career was supposed to go a different way, but that is the nature of professional sport."