The 21-year-old has put pen to paper on a four-year contract at London Road after spending a spell on loan with Posh last season.
Payne made 11 starts and three substitute appearances over the final four months of the Championship campaign but could not prevent Darren Ferguson's side suffering relegation.
A statement on Gillingham's official website read: "Jack Payne has joined fellow League One side Peterborough United on a four-year contract for an undisclosed fee.
"Everyone at the club would like to thank Jack for his services and we wish him the best of luck during his time at Peterborough."
Payne, who started out as a trainee at Priestfield, made his debut for Gillingham as a 16-year-old against Chester in October 2008 and went on to make a total of 113 appearances, scoring six goals.
Posh chairman Darragh MacAnthony wrote on Twitter: "Some good news non striker related. Pleased to announce Jack Payne has signed a 4 yr deal with us. Quality acquisition Poshies.
"I'm pleased we as a club continue to purchase top quality young league talent which in turn sees FL clubs benefit financially.
"Jack P will only enhance our already strong squad as we work towards competing for league 1 honours."