The 22-year-old, who was reportedly attracting interest from Bath and Saracens as well as clubs in France, will join the Sharks next June.
Gray joins fellow Scots Fraser McKenzie, Richie Vernon and Alasdair Dickinson at Edgeley Park.
Gray, regarded as one of the northern hemisphere's rising forward talents, was persuaded to join the Sharks by executive director of sport Steve Diamond, who also revealed an agreement to sign a second forward.
Diamond said: "Richie is the first to be announced of two who have already agreed to join us.
"Richie is only 22 but has the makings of a world-class forward and he has been courted by a number of Premiership clubs and several French clubs.
"But he has bought into our vision at Sale Sharks and wants to spend the next part of his career in Manchester."
Gray played in all of Scotland's games in the recent World Cup and has won 16 caps for his country.
Diamond added: "Sale Sharks have a great relationship with Scottish players down the years from Bryan Redpath and Jason White through to Alasdair Dickinson, Richie Vernon and Fraser McKenzie.
"Our toughest two weeks are now over but we've now got to make sure we go into the next period of league games ensuring that we iron out those little errors.
"The aim now with all the guys back from the World Cup is to get everyone bedded in properly and get some consistency going into the next set of games."
Sale will look to bounce back from successive Aviva Premiership losses to Leicester and Saracens when they travel to play French club Brive in the Amlin Cup on Saturday.
Gilbert has released a new line of rugby cleats. The Gilbert Virtuo 8S is part of the exciting new product. Check it out.
The entire All Blacks apparel line has been updated for 2013/14. Check out the New Zealand All Blacks polo.
The Nike Tiempo is a solid rugby cleat and one of few styles still made from full-grain natural leather.
The Gilbert Blitz 8S rugby cleat is a great cleat at a great price of $69.99. Get a new pair of cleats today.
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.
The All Blacks Performance t-shirt is black with hints of blue from the training jersey. Very Cool.
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.