Doug Hendrickson, Godfrey's agent, said the deal is worth $27.5 million overall, $12.4 million guaranteed.
"He's on top of the world, and he's thrilled because this is what he wanted," Hendrickson said. "He really loves the new defense and the staff and everything about the organization. They stepped up big time."
His contract was set to expire after this season.
Godfrey, one of the team's six captains, is the latest Panther defender to earn a contract extension of at least five years, joining defensive end Charles Johnson and linebackers James Anderson, Jon Beason and Thomas Davis as the team makes a concerted effort to keep its core players.
A third-round draft pick in 2008, Godfrey has started 43 games over the past three seasons with the Panthers and has 157 tackles, seven interceptions and six forced fumbles during that span. He led the team last season with five interceptions.
His role has expanded this season as the Panthers plan to use him some at cornerback when the team goes to its nickel package.