You can move out whenever you like but will still be liable for the rent until the end of the tenancy period unless the landlord agrees to you ending the tenancy early.
it will say in your tenancy agreement. Often it will be something like if you sign for 12 months you can get out after 6 months giving one month notice.