In most cases, the length of the visa depends on the length of your course. However, certain personal circumstances may affect the length of your visa as well.
The most common reason your student visa may be issued for a lesser time is due to your passport expiry date. Your student visa will have to expire before your passport does.
If you are in this situation, you will have to renew your passport and then apply for a new student visa, if you wish to continue studying.