If you want to study in Sweden for more than three months, you need a residence permit.
Here you can find more information about study in Sweden.