The deal is worth $35 million and includes a $13 million club option that could increase if it vests, a source told ESPN.com's Jayson Stark.
Gyorko's guaranteed $35 million deal is the third-largest for a player with only one year of service time, trailing only Atlanta's Andrelton Simmons (seven years, $58 million) and Milwaukee's Ryan Braun (eight years, $45 million).
Gyorko, 25, had a team-leading 23 home runs in 125 games last season, his first year in the majors.
"We are happy to sign Jedd and secure the rights to two free agent years," general manager Josh Byrnes said in a statement. "Jedd is a homegrown player in his fifth season with the Padres organization and has been a consistent performer every step of the way."
He has gotten off to a slow start this season, batting just .163 with one homer in his first 12 games.
ESPN's Keith Law and Buster Olney contributed to this report.