The 32-year-old announced on Facebook he has had surgery on the problem and will return to action in 2018.
Last month, the Swiss struggled and needed ice on his knee as he was knocked out in the first round of Wimbledon by Russia's Daniil Medvedev.
"I love this sport and I will work hard to get back to my top level and play many more years," said Wawrinka.
This season, the three-time Grand Slam champion reached the final of the French Open and the semi-finals of the Australia Open.
He added: "After talking with my team and doctor I had to make a difficult decision to undergo a medical intervention on my knee. This was the only solution to make sure I will be able to compete at the top level for many more years.
"This is obviously extremely disappointing, but I am already looking ahead and planning my recovery. I love this sport and I will work hard to get back to my top level and play many more years.
"I also want to take this opportunity to thank my fans for sending plenty of messages of support during the last couple of days. I will see you all in 2018."
Former world number one Novak Djokovic will also miss the US Open because of an elbow injury.
US Open champion Stan Wawrinka will not defend his title in New York later this month because of a knee injury.