The 36-year-old full-back was a free agent after leaving Crystal Palace in the summer.
Lawrence told BBC Radio Kent: "I know Andy [Hessenthaler, Gills boss] from playing against him and the type of character he was.
"I guess I just wanted to work with that sort of person. I hope to come here and get promoted."
The Gills travel to Sixfields at the end of October for a League Two clash with Northampton.