The 26-year-old's previous deal with the Munich giants had been due to expire next summer, and there has been a host of speculation surrounding his future over the last few weeks.
Chelsea, Manchester United, Manchester City, Liverpool and Arsenal had all allegedly been keeping a close eye on the developments surrounding the Germany international.
However, Bayern, who are on the verge of selling Robert Lewandowski to Barcelona, have announced that the versatile attacker has extended his deal until the end of the 2025-26 campaign.
"I thought a lot about what I want as a player in the coming years, and came to the conclusion that I want to stay at FC Bayern, win everything again here and experience things - in particular celebrating another Champions League title, but this time with our fans," Gnabry told the club's official website.
"It's special because I get to play here with my friends at the highest level. It certainly wouldn't feel the same at a different club. I want to experience more great moments here - and nowhere else. The hunger for major honours isn't going away."
Meanwhile, Bayern president Herbert Hainer said: "It's another strong signal that a player like Serge Gnabry sees his future at FC Bayern. He's won everything here and identifies with the club so much that he wants to help write more chapters of club history.
"When he's on the ball, he's a joy to watch. With him, Sadio Mane, Thomas Muller, Kingsley Coman, Leroy Sane and Jamal Musiala, FC Bayern have outstanding options on the flanks which are among the best in European football."
Gnabry featured on 45 occasions for Bayern during the 2021-22 campaign, contributing 17 goals and 10 assists, including 14 goals and six assists in 34 Bundesliga matches, as the Munich giants won the title once again.
He has made 171 appearances for the German champions since arriving from Werder Bremen in 2017, scoring 64 goals and contributing 40 assists in the process.
Bayern CEO Oliver Kahn also paid tribute to Gnabry, hailing his "spectacular style of play" and claiming that the club "need" players of his calibre to continue challenging for major honours.
"With his spectacular style of play, Serge Gnabry is a player who fans come to watch. We're glad that he's extended his contact and look forward to him continuing to be an important part of our team," said Khan.
"Serge came to Munich at the age of 22 and has grown into a Champions League winner and international here. We need top international players like him to achieve our big objectives."
The attacker has won four Bundesliga titles, two DFB-Pokal trophies and the Champions League during his time at Allianz Arena and is now contracted to the club for a further four years.
Bayern will take on RB Leipzig in the German Super Cup on July 30 before opening their 2022-23 Bundesliga campaign away to Eintracht Frankfurt on August 5.