The 21-year-old has been playing in the Glasgow first team since 2012 and made his senior international debut the following year.
Gray regularly partners brother and former Warriors lock Richie in Scotland's second row.
"I'm very happy to be staying at Glasgow," the younger Gray told Glasgow's website.
"It's my home club and I'm just glad I've had the opportunity to sign.
"It's been a a fantastic few years development for me. When I was younger I always had the ambition to play for Glasgow and Scotland and playing in a Rugby World Cup has been a fantastic experience.
"It's great to see [team-mate and fly-half] Finn [Russell] signing as well [for three years] and there is a lot of talent at the club and it's great to be a part of it.
"Everyone works very hard and that just makes you want to improve as a player and improve the team as well. To have the opportunity to work with the coaches and players at the Warriors is fantastic.
"Scotstoun is a fun place to be and everyone works hard for each other and the culture is great.
"I used to go and watch my brother playing at Firhill and it's incredible to see the crowds growing since we moved to Scotstoun. The fans are really passionate and they make it a very special place to play."
Gray has made around 60 appearances for club and country in his professional career and played in four of Scotland's five matches during their World Cup campaign, which ended at the quarter-final stage.
And head coach Gregor Townsend said: "Jonny has made a huge contribution over the last couple of seasons and it's great news that he's staying with us for another three years.
"He works very hard and has made the breakthrough for club and country over the last couple of years."

Max Schrems wants the court to order the Irish Data Protection Commissioner to audit Facebook to see what material it passes on to the US authorities.
The privacy watchdog had previously said the transfers were protected under the Safe Harbour trade agreement.
But a fortnight ago the European Court of Justice ruled the pact invalid.
The ECJ said that as a consequence the Irish regulator was indeed required to examine Mr Schrems' complaint with "all due diligence" and ultimately decide whether to suspend transfers if it believed the firm was not providing an "adequate level of protection" to protect people's privacy.
Following the ruling, the Irish data commissioner sought guidance from the High Court about how it should proceed, resulting in the latest proceedings.
Mr Schrems alleges that whistleblower Edward Snowden's leaks demonstrate that Facebook - as well as other technology companies - "aids US spy agencies for mass surveillance" in breach of the EU's Charter of Fundamental Rights.
Facebook strongly denies providing "backdoor" access to the US intelligence agencies and says its data-transfer processes were reviewed by the Irish watchdog as recently as 2012.
The social network, whose European headquarters is in Dublin, has requested permission to voice its case at the High Court, but has yet to find out whether it will be permitted to do so.
"We believe it is critical that we join the proceedings so that we can provide accurate information about our procedures and processes, as well as to correct inaccuracies that already exist," a Facebook spokeswoman told the BBC.
Mr Schrems has previously cast doubt on what information the California-based company might provide.
"Facebook is very likely bound by 'gag orders' and is not allowed to confirm such cooperation with US authorities," he wrote earlier this month.
"Facebook spokespersons [who comment on the matter] typically do not have the necessary security clearance to know about such programmes themselves."
The case could set a precedent that influences how other EU regulators handle complaints about data sent to US-based computer servers for processing and storage.
A spokeswoman for the Irish Data Protection Commissioner said it was not yet clear when the High Court would rule on how the dispute should proceed.
Scotland lock forward Jonny Gray has signed a new contract with Pro12 champions Glasgow Warriors until 2018.
[NEXT_CONCEPT]
The High Court in Dublin is to resume a case in which a privacy campaigner is trying to block Facebook from sending EU citizens' personal data to the US.