The 24-year-old, who plays for Napoli, sustained the injury during Scotland's final World Cup warm-up match and will return to his club to begin rehabilitation.
"I am devastated for Billy because he has been an integral part of our World Cup qualifying campaign," Scotland manager Steve Clarke said.
"The timing of this injury is so cruel and we all feel for him."
Gilmour featured prominently in Scotland's successful qualifying campaign and had been expected to play a key role at the tournament.
"He knows what we all think of him as a footballer and a person," Clarke added. "I am certain Billy will have many major tournaments ahead of him in the future."
Scotland begin their first World Cup campaign since 1998 against Haiti on June 13 before facing Morocco and Brazil in Group C.
