Skjei, 24, who will count $5.25 million against the salary cap through the 2023-24 season, was a restricted free agent. He had four goals and 21 assists for the Rangers last season, and he was the only player on the team to appear in all 82 games.
Skjei also was second on the team with 127 hits and 119 blocked shots.
The deal was reached three days before his arbitration hearing was scheduled.
Skjei is a poster boy for the Rangers' rebuild as a young, homegrown player counted on to take on an increased role. The 2012 first-round pick has already played 169 NHL games, and his his 64 points ranks ninth among league defensemen under the age of 25 during the last three seasons.
Playing all 82 games last season, Sjkei averaged a career-high 21 minutes a game and had four goals and 21 assists. He was 10th in Calder Trophy voting for rookie of the year in 2016-17 when he had 39 points.
The Associated Press contributed to this report.