On Tuesday, the Rams announced the move, which will keep Goff with the reigning NFC champions through 2020, on Tuesday.
Goff's salary for 2020 will be $22.783 million, a substantial increase from the $4.259 million he is owed for the upcoming season, per Spotrac.
Goff told reporters last week he wasn't concerned about pushing the Rams for a long-term contract extension.
"Not on my mind at all," he said. "I know the deal and understand that I hired an agent for that reason, and things always work out. You continue to play well, it will work itself out."
The past two seasons have been a remarkable turnaround for Goff. His rookie campaign in 2016 was a struggle with a 54.6 completion percentage, five touchdowns, seven interceptions and a record of 0-7.
ESPN.com's Seth Walder noted in the site's July 2017 football power index that the Rams were "predicted to have the worst offense and "would have a better chance of winning with backup Sean Mannion."
Hiring Sean McVay as head coach has unlocked Goff's potential. The 24-year-old has thrown for 8,492 yards with 60 touchdowns and a 63.6 completion percentage over the past two seasons.
The Rams have won back-to-back NFC West titles, reaching Super Bowl LIII after the 2018 season.