The Wales Under-21 international has made 40 appearances in all competitions for the club so far this season.
Centre-back Lockyer, 21, began his career at Rovers and has played in 140 competitive games since 2012.
Left-back Lee Brown has also signed a new contract extension for Rovers, who are fourth in table, two points off an automatic promotion place.
Bristol Rovers defender Tom Lockyer has signed a new undisclosed-length deal with the League Two club.