San Francisco selected Kilgore in the fifth round of the 2011 draft out of Appalachian State.
He has played in 33 regular-season games, plus all six playoff games the last two seasons. He has split time at guard and center.
With veteran center Jonathan Goodwin set to become an unrestricted free agent, Kilgore could take over the starting center role next season.
Goodwin has started every game for the 49ers the last three seasons under coach Jim Harbaugh.
Niners general manager Trent Baalke said in a statement that Kilgore’s deal is “another example of our philosophy to extend the contracts of our own young players.”