In order to get your student visa, passports MUST be valid six months after your program end date. For example, if your program ends in May, then your passport would need to be valid through November of that year.
If your passport is going to expire any time prior to six months after your program end date, then you should begin the process of renewing your passport right away.