If you are going to study at a university or university college in Sweden for longer than three months, you must have a residence permit. The permit must be in place before you travel to Sweden.
To obtain a residence permit, you must:
More detailed infromation about rules, regulations and required documents can be found on the Swedish Migration Agency's website.
The easiest way to apply for a residence permit is to apply online over the internet. An online application goes directly to the Swedish Migration Agency.
Studying in higher education - Migrationsverket
If you are still unable or do not want to apply online, you can submit an application at the Swedish Embassy.