The 33-year-old was set to play Klara Koukalova in the second round having defeated Ysaline Bonaventure of Belgium 6-2, 6-1 in her opener on Wednesday at the claycourt event she won in 2013.
"I was having some pain in my right elbow," Williams said.
"I felt it a little bit in my match yesterday, and then it got better, but then this morning I really couldn't hit serves, and if I'm not able to hit serves that could definitely be a problem.
"So I talked to my coach about it and we were like, 'Let's see what the doctor says, and see what everyone else says, and go from there.' The main thing is that we don't want it to get worse, we obviously want it to heal.
"Unfortunately I haven't had time to heal. I've been going, going, going, playing tournaments I love, and coming here has been such a great joy, but unfortunately it's not going to heal if I keep playing."
Williams swept to a sixth Wimbledon title on Saturday, her 21st career major and her third in three Grand Slam events this year.
If she defends her US Open crown in September, she will become the first woman since Steffi Graf in 1988 to complete a calendar Grand Slam.
"I'm going to take some time off, I'm going to get some treatment, and I'm going to continue to do things for it. I'll do what's best for my body and continue from there," Williams told www.wtatour.com.
Williams is scheduled to play in Stanford, Toronto and Cincinnati before the US Open.
Elsewhere in Bastad on Thursday there were wins for third seed Barbora Strycova who beat Evgeniya Rodina, 6-4, 6-1, Sweden's Rebecca Peterson seeing off sixth seeded Katerina Siniakova, 7-5, 7-6 (8/6), and Yulia Putintseva defeating French qualifier Alize Lim, 6-0, 1-6, 6-2.
The last match of the day saw seventh seed Johanna Larsson edging Anna-Lena Friedsam, 6-3, 7-5.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ