Also, May and July are great alternatives when you're deciding when to go to Sweden. However, May can be a bit more rainy than June, and while July is warmer, it also has larger tourist crowds. July and August can also be slightly more expensive that the earlier summer months, so June is still your best bet, as far as when to go to Sweden.
If you're a budget traveler trying to decide when to go to Sweden, I'd highly recommend late August and September. The flights to Sweden will be cheaper than during the high season, along with local hotel prices. And during that time, the weather in Sweden is still mild enough for outdoor attractions, although some sights begin to close during September.
As a winter traveler in Sweden, the question is not so much when to go to Sweden (as any month between November and March is cold and snowy). No, it's more about when you can avoid the crowds in the winter sports areas. The busiest times in Swedish ski resorts are late February, March, and December. It's really idyllic during Christmas in Sweden, though, plus you can visit the romantic Christmas markets in the bigger cities. And it's also the best time to see the Northern Lights in northern Sweden.
Now you know what to expect, and it'll be easier for you to decide when to go to Sweden.