Coyle's deal is for six years, running through the 2025-26 season, with an annual cap hit of $5.25 million.
Coyle, 27, is now the Bruins player under contract for the most years. Brad Marchand's deal runs through the 2024-25 season.
Wagner's contract is for three years, through 2022-23, with an annual cap hit of $1.35 million.
"On and off the ice these guys walk the walk," Bruins general manager Don Sweeney said. "They both take care of themselves so I'm not concerned about the longevity side of things."
Coyle was acquired at last season's trade deadline from the Minnesota Wild. In eight NHL seasons, he has skated in 524 games, scoring 98 goals with 164 assists. That includes five goals and 14 assists in 24 games this season for the Bruins, who are on a four-game winning streak and sit atop the Atlantic Division.
Coyle is a Weymouth, Massachusetts, native and was a first-round pick of the San Jose Sharks in the 2010 draft.
Wagner, 28, has played in 273 games over six NHL seasons with the Ducks, Avalanche, Islanders and Bruins, scoring 30 goals with 23 assists. He is coming off a career-best season in which he scored 12 goals and tallied 19 points.
Wagner, a native of Walpole, Massachusetts, has one goal and four assists in 23 games so far for the Bruins this season, and leads the team with 65 hits.
"They're hometown guys, they clearly want to be here," Sweeney said. "They understand the pressure associated with playing for the Bruins and they're really good teammates. For us it was a really good fit and we're really excited to have them."