Heinen and the team avoided arbitration by agreeing to this new pact. A hearing had been scheduled for Aug. 3 if he didn't sign beforehand.
The 24-year-old recorded 11 goals and 34 points in 77 regular-season games with the Bruins this past season, adding eight points in 24 playoff contests this spring.
Heinen briefly saw time on the club's top line when David Pastrnak was hurt toward the end of the regular season.
He spent the last two seasons primarily at the NHL level with Boston, notching 27 goals and 81 points across 154 contests over that span. He was held off the score sheet over an eight-game stint with the Bruins in 2016-17.
Boston drafted the center 116th overall in 2014.