The 25-year-old was released by League One side Bournemouth last month and Gills boss Martin Allen has wasted little time snapping him up.
Gregory has penned an 18-month deal at Priestfield and becomes the Kent club's second capture of the January transfer window after defender Leon Legge.
Gregory started his career with Wycombe before dipping into non-league football and later returning with AFC Wimbledon, helping the Dons earn Football League status.
Bournemouth secured his services in the summer of 2011, but he found his first-team opportunities limited at Dean Court this season and spent three months back on loan at AFC Wimbledon.
- Sports & Recreation