The 34-year-old, who was capped twice by England, made his 200th Aviva Premiership Rugby appearance in the final match of the 2011/12 regular season, with his 201st, and final, match coming in the semi-final loss to Harlequins.
Long played 38 times in all for the Saints in his two-and-a-half years at the club and picked up an LV= Cup winners' medal in 2010. His career also included spells at Bath, Munster, Rotherham, Newcastle Falcons and Cetransa El Salvador.
Although disappointed that he could not continue his career, Long says that he had no regrets after playing rugby for nearly 30 years.
"I've achieved everything I wanted to achieve out of rugby," he said. "I started playing aged four and went all the way to the top to play for England at Twickenham.
"I've had 200 games of Premiership Rugby and played for some great clubs who have all had magnificent supporters, and I'm at peace with the fact I'm having to retire.
"That said, I had signed for Gloucester so I wanted my career to continue, but I'd been carrying an injury which was causing me a few problems towards the end of last season, and the rehabilitation time from an operation would have meant that I would have been on the sidelines well into next season, too.
"I am devastated that I was not able to contribute to Gloucester in the way that I hoped as I was really excited about playing for such a great club, but am nevertheless glad that my career finished in the way that it did, playing for a great club like Northampton in the Aviva Premiership Rugby knockouts."
Gloucester Rugby Forwards Coach Carl Hogg expressed his regret that Long would not be able to move to Kingsholm as planned.
"It's hugely disappointing for Andy. I know that he was looking forward to coming here and we were keen to welcome him to Gloucester.
"However, injuries do happen, Andy has had to make a difficult decision and we completely respect that. We'd like to wish him well in all his future endeavours."