On a student visa you are allowed to stay for the duration of your course, as specified in your initial visa application.
You will also be allowed to stay for a short time following the completion of your studies however this can be anything from 60 days to 4 months depending on your chosen destination.