If you will be studying in Sweden for more than three months and you are not an EU citizen, you need a residence permit. If you will be studying for less than three months, you may need a visa instead.
Applications for residence permit to study at universities and colleges in Sweden are handed in online at the Swedish Migration Agency's website here
If you are applying online and do not need a visa to enter Sweden, you do not usually have to visit the Embassy.
List of countries whose citizens need a visa
The fee differ depending on what kind of permit you apply for. The fees are available here.
All the most important information on higher education in Sweden can be found on the Study in Sweden website and on the Swedish Migration Agency's website.
The Swedish Migration Agency handles and decides in applications for residence permit in Sweden and the Embassy cannot influence the decision. If you have questions regarding student permits you can contact the Swedish Migration Agency.