If you are visiting Sweden and are a citizen of an EU country you have the right to stay in Sweden for as long as you like.
If you are visiting Sweden and are a citizen of an non-EU country you will have to apply for visitors visa/permit. This will give you the right to visit and reside in Sweden for a maximum of 90 days. If you wish to extend that period you can apply for a visitor’s residence permit.