If you are a student from a country outside the EU/EEA or Switzerland, you need to check that you are entitled to stay in Norway. UDI, the Norwegian Directorate of Immigration, determines if you are entitled to stay in Norway. Read more on udi.no about study permit in Norway.
You also need to check if you have health insurance from your home country. If you don't, you should check with Nav whether you are entitled to join the Norwegian national insurance scheme. Read more on nav.no about membership in the National Insurance Scheme.
If you are a member of the Norwegian national insurance scheme while you are studying in Norway, you will be entitled to subsidised health care from the public health care system. You should still consider taking out private health insurance. This can be used, for example, to meet the costs of medical transport back to your home country if you fall ill.
If you are covered neither by the Norwegian national insurance scheme nor by health insurance from your home country, you should make sure you take out private comprehensive health insurance.
Example
Zahra from Iran is taking a master's degree in mathematics at the Norwegian University of Science and Technology in Trondheim. She is a member of the Norwegian national insurance scheme and therefore receives health care in the same way as Norwegian citizens. She is in a road accident and suffers a serious spinal injury. Zahra wants to return home to Iran as quickly as possible. Fortunately, she has taken out travel insurance that covers medical transport back to her home country in the event of illness.