He will make $2 million the first year after having earned $875,000 last season on an entry-level contract.
Subban did not attend training camp and missed the first four games of the regular season while negotiating with the NHL club.
"I'm extremely happy to be at this point now where the past is behind us and I can look forward to being integrated to this team and helping them after such a great start," Subban said.
"The longer this thing holds over our team, the bigger a distraction this comes. I'm so happy this decision has been made."
The 23-year-old led the team in average ice time per game last season at 24 minutes, 18 seconds.
He had seven goals and 29 assists in 81 games and was seventh among NHL defensemen with 205 shots on goal.
In his NHL career, he has 21 goals and 55 assists in 160 games.
Information from ESPN The Magazine's Craig Custance and The Associated Press was used in this report.