Gray sustained the injury during Exeter’s 47-28 Heineken Champions Cup semi-final defeat by La Rochelle on Sunday.
“It’s relatively serious without being the worst it could be,” said Exeter rugby director Rob Baxter. “From what I’ve been told unless the operation goes exceptionally well and his recovery is exceptionally quick, I would say he is very doubtful for the World Cup.
“It’s a patella tendon injury, he’s dislocated his kneecap. Fortunately the other major ligaments within the knee are all stable. It’s a relatively complex patella tendon injury, which is going to require surgery this week, and there’s a relatively long period of rehab
“We are hopeful to have him back fairly early next season, especially with the Premiership starting late next year with the World Cup first.”
Second-row Gray, 29, has won 77 caps for Scotland and his absence from the World Cup in France would be a huge blow for Gregor Townsend’s side.
Scotland start their World Cup campaign against defending champions South Africa in Marseille on September 10. Pool B also includes Six Nations Grand Slam champions Ireland, Romania and Tonga.