Frampton, who was born in Wimbledon, helped Gillingham clinch the League Two title last season.
He began his career at Crystal Palace and has had spells at Brentford, Orient, Swindon and Millwall, where he played alongside Dons manager Neal Ardley.
Ardley told the club's official website: "I played with Andy at Millwall so I know that he is a winner and a fantastic player.
"Martin Allen echoed those thoughts when I spoke to him earlier this week; he said that we had a good player because of his attitude around the place and his character. Although he is 33, Andy looks after himself and I am sure he will have a good few years yet."
Frampton added: "It means a lot to me to sign for Wimbledon because I grew up nearby and I know about the history of the football club.
"When I played against Wimbledon for Gillingham at the end of last season the fans created a lot of noise and it ended up a good day for both clubs.
"Once Neal sold the club to me and what he wanted to achieve it was a no-brainer to sign and I am excited by the challenge ahead."