The 24-year-old British & Irish Lion, who joined the Scottish Rugby Elite Development Programme at the age of 17, made his debut for Glasgow in 2011. He has gone on to make 87 appearances for the Scotstoun-based side.
Earlier this year Hogg, who has 45 caps for Scotland, was voted the RBS 6 Nations Player of the Tournament after scoring tries against France and Ireland. He has scored 11 times for his country.
In 2013 he was the youngest member of the series-winning British & Irish Lions squad in Australia and in 2015 he was part of the Glasgow Warriors squad which won the GUINNESS PR012 title.
Primarily a full-back, but also comfortable at centre and stand-off, the former Hawick High School pupil is a product of the famous Hawick and Hawick Wanderers clubs.
Speaking exclusively to glasgowwarriors.org, Stuart Hogg said: "Glasgow Warriors is such a big part of my life - I love this club.
"I've played for the Warriors for five years and it was an easy decision to sign for another two seasons.
"My wife enjoys living in Glasgow and with a young boy and another baby on the way there is nowhere else I'd rather be.
"There is still a lot of rugby to be played this season and then next season I'm looking forward to working with Dave Rennie when he takes over.
"It means a lot to me that the club and Scottish Rugby want me to stay and I'm very happy that I'm going to be continuing my career in Scotland."
Glasgow Warriors head coach Gregor Townsend said: "This is excellent news for Glasgow Warriors and Scottish Rugby.
"Stuart works extremely hard in training every day to improve himself and he gets real joy from playing the game.
"He is entering the best years of his career, as he is in great physical shape and he has become one of our most experienced players.
"The fact he wants to continue to play his rugby in Scotland is a massive boost for the development of the club and it's exciting for our supporters.
"I firmly believe that we can compete with the best teams in Europe and having Stuart on board for another two seasons will certainly help."
Scottish Rugby CEO Mark Dodson added: "This is a really important signing for Glasgow Warriors and Scottish Rugby.
"It is our intention to keep as many of our best players in Scotland as we can and despite the sharply increased costs of professional rugby we are delighted to have secured Stuart for the next two seasons.
"This signing illustrates our commitment to Glasgow Warriors and demonstrates to the fans that we want to repay their fantastic support, and the club means business."