Most students will sign a fixed term agreement which runs for a fixed period of time, usually 12 months but it can be 6 or 9 months.
Ensure the fixed term period is appropriate and covers the period you expect to be in the property. A fixed term agreement is very hard to get out of and unless there is a ‘break clause’ in your agreement allowing you to leave early, you would remain liable for rent for the remainder of the fixed term period.
It may be possible to negotiate with your landlord if you want to leave early but this is entirely down to the discretion of the landlord.