If your residence permit is valid for less than one year, you are not entitled to a Swedish personal identity number (social security number). This means that you will not automatically be granted access to health insurance.
However, many universities offer health insurance for their students (conditions apply). See information on the universities websites.
Also, universities have their own health care services, free for students. This is usually a good point of first contact, as they can direct you further.