The 23-year-old enjoyed an outstanding first season with Quins after arriving from Northampton last summer, establishing himself as the first-choice hooker following his debut against Cavalieri Prato in the Amlin Challenge Cup.
Gray played the entire 80 minutes as Quins won the final of that competition against Stade Francais, and was part of Stuart Lancaster's victorious England Saxons squad at the Churchill Cup.
And Quins director of rugby Conor O'Shea believes Gray has a bright future ahead.
He said: "Joe has made an incredible impact at Harlequins and in the Aviva Premiership, and finishing up in the Saxons group last season was just reward for his work.
"The person, as much as the player, is an important part of what we believe in, and in Joe we have someone who embodies our values to the full.
"We believe Joe has the ability to get better and better, and we are looking forward to him achieving his goals with us over the coming years."
Gray himself added: "I am really pleased to have re-signed with Quins. Since joining Harlequins two years ago, not only has my rugby improved but also my enjoyment for the game. The team plays a great style of rugby and I am excited about the future."
The London club also announced that Academy lock Charlie Matthews, who made his Premiership debut against London Irish on the opening day of the season, has agreed a new contract.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The Barbarians are one of the top invitational rugby sides with a long history and classic rugby jersey.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Lions get ready for their matches with this green training jersey. It's what the players wear. Get in the Gear!
A cool looking all black rugby cleat with the high performance adidas is known for. Get in the Gear!
Wear the crest of the British and Irish Lions on your t-shirt. A great look for the summer.
$29.99
The Lions are ready to get their Australia tour underway. They arrive in Perth on Monday.
The New Zealand All Blacks training jersey for 2013/14. Get in the Gear!
The USA Rugby Pro Alternate rugby jersey is perfect for any fan of the Eagles. Get yours to wear during the summer Test matches.
The NEW All Blacks 2013/14 jersey has arrived at World Rugby Shop. Dare to wear the colors of the All Blacks.