The 18-year-old defender, who made his debut as a substitute in the 3-0 win over Fleetwood in January, has signed a two-year deal.
"The gaffer got a chance to see what I was about this season and I'm happy," Lockyer told the club's official club website.
"This is good, but I have not made it yet, in years to come I want to be the first name on the team sheet every week."
Pirates chairman Nick Higgs added: "I'm delighted that Tom has committed his future to Bristol Rovers.
"It's just another example of how well our youth system is developing, and how there are opportunities for young players to make the step up to the first-team squad."