Knox, whose nine touchdown catches in 2021 tied for the most in the NFL for a tight end, will receive $31million guaranteed, according to NFL.com, with the total value of the deal coming in at $53.6m.
The 25-year-old Knox was entering the final season of his rookie contract.
"I couldn't be more excited to call this place home for another four years," Knox said in a social media post after the Bills announced his extension on Wednesday.
"Can't wait to get this season rolling. Go Bills!"
A third-round pick of Buffalo in the 2019 draft, Knox compiled 52 catches for 676 yards and five TDs over his first two seasons before delivering a breakthrough 2021 campaign.
The Mississippi State product set a franchise record for touchdown catches for a tight end and posted career highs of 49 receptions and 587 receiving yards in 15 games.
Knox added two more TD catches in Buffalo's 47-17 rout of the New England Patriots in the opening round of last season's AFC playoffs.
The fourth-year pro has also developed a special bond with the city of Buffalo, one which has grown stronger from the community's reaction to the sudden death of Knox's brother, Luke, in August.
Bills fans raised over $200,000 in Luke's name to the P.U.N.T. foundation, a pediatric cancer charity that Dawson Knox has actively supported.
"The amount of texts I've gotten, the messages, the posts, the moment of silence for the preseason game – it's just been everything that I expected out of Buffalo and more because this city is incredible," Knox told the Bills' official site earlier this week.
"This is such an incredible city with such an incredible fan base and people. It really truly does feel like home.
"I know I've said that before, but I kind of realised that for the first time when I came back up here after everything that it really does feel like a second home to me."
Luke Knox, a linebacker at Florida International University, died unexpectedly of unknown causes last month at the age of 22.