The extension is worth $134 million and includes an NFL-record $110 million guaranteed, a source told ESPN's Adam Schefter.
Those figures top the ones the Philadelphia Eagles awarded quarterback Carson Wentz in early June. Wentz, who was selected second overall behind Goff in the 2016 draft, got a four-year extension worth $128 million, with $107.9 million guaranteed.
Goff, 24, is entering the fourth season of his five-year rookie deal. He is scheduled to earn $4.3 million this season and $22.8 million in 2020. With the two existing years he had remaining on his contract, Goff is now tied to the Rams for six seasons and $161 million, a source told Schefter.
At the outset of training camp, Rams general manager Les Snead said that it was "not a matter of if but when" a deal would be made with Goff, and Rams coach Sean McVay said that he hoped to be "stuck" with Goff for a long time.
The Rams made a dramatic move up the draft board to select Goff in 2016, trading from the 15th pick to the top overall selection. They have been on the clock to complete an extension with Goff since Wentz signed his extension with Philadelphia.
When asked during training camp what he wanted in a contract, Goff said, "I'm interested in winning games, and whatever the best way to do that is, is what I'm for."
Following a tumultuous rookie season, which included seven winless starts under former Rams coach Jeff Fisher, Goff has flourished.
In two seasons under McVay, Goff has led the team to consecutive division titles, an NFC championship and an appearance in Super Bowl LIII, which was the Rams' first Super Bowl appearance since the 2001 season. He has been selected to two Pro Bowls and is 24-14 as a starter.
Goff has passed for 9,581 yards and 65 touchdowns, with 26 interceptions, and has completed 62.1% of his throws.