The team announced that the contract carries an annual average value of $2.85 million.
The Bruins signed defenseman Charlie McAvoy to a three-year, $14.7 million deal Sunday, leaving the team about $3 million under the salary cap.
Carlo, 22, said he kept in touch with McAvoy throughout the process and it was getting difficult to sit out.
"It was stressful for me throughout these past couple days, especially after Charlie signed, to not be a part of camp," Carlo said at a news conference Tuesday. "It's hard not being there grinding with your teammates. I was getting really antsy, couldn't even get comfortable on the couch the past couple days, but really excited to be here."
While Carlo doesn't have the offensive prowess of McAvoy, he started to fulfill some of his promise on defense this season. Carlo posted a plus-22 and drew some tough assignments in the playoffs as the Bruins advanced to the Stanley Cup Final.
Carlo often found himself on the second pairing with Torey Krug.
Carlo is coming off a two-year entry-level contract that had a cap hit of $789,167.
"I don't think you put a ceiling on what he's capable of doing," Bruins general manager Don Sweeney said. "But he also has to live up to his own ideals of what he does really well and, obviously, shutting down and taking responsibility at the end of games, close out games, protect leads, block shots, to do the things that other players might not be as willing to do, he does really well, and then allowing his game to grow offensively."
Said Carlo: "I feel like I can get up in the rush a little bit more and contribute, and I think with confidence I'll recognize that more on the ice."
The Associated Press contributed to this report.