The Italian said he had started feeling ill on Monday after a practice week in Monaco and was advised to drop out.
"After seeing my doctors on Tuesday and waiting an extra day to give myself some more time to see if my condition would improve, things unfortunately got worse," Sinner said in a statement.
"I was looking forward to competing with my teammates and the rest of the Italian team, but for now that will have to wait.
"As advised by my medical team, I will now take some time to rest and recover to full health. I'd like to wish the whole team Italia the best for this important event and hope to be back stronger in the future."
Sinner said the Olympics had been "was one of my main goals for this season".
The 22-year-old, who won his first Grand Slam at the Australian Open earlier this year, became the first Italian to top the world rankings after his recent run to the semi-finals at the French Open.
He withdrew from the Madrid Open before the quarter-finals with a hip injury and missed the tournament in Rome in the run-up to Roland Garros.
Sinner needed a lengthy medical timeout after feeling dizzy and appearing to almost lose his balance during his quarter-final defeat to Daniil Medvedev at Wimbledon.
The tennis competition in Paris begins at Roland Garros on July 27 and ends on August 4.