The deal begins in the 2015-16 season after the final season of his current contract.
Krejci led the Bruins last season with 50 assists and 69 points. He also led the NHL with a 39 plus-minus rating. In eight NHL seasons, all with the Bruins, he has 110 goals, 268 assists and 378 points in 504 regular-season games.
The 28-year-old Krejci was the playmaker on the Bruins' top line last season with right wing Jarome Iginla and left wing Milan Lucic. Iginla tied for the team lead with 30 goals and was third with 61 points but signed as a free agent after the season with the Colorado Avalanche. Lucic finished with 24 goals and 35 assists and was fourth on the team with 59 points.
When the Bruins won the Stanley Cup in 2011, Krejci led them with 12 goals and 23 points in 25 post-season games. He also was the highest post-season scorer in the NHL in 2013 with 26 points.
But last season, Krejci had a poor post-season with no goals and four assists in 12 games as Boston was eliminated in the second round.