If you're still within your fixed term, check to see whether your tenancy agreement contains a ‘break clause'. 

This will allow you to end the agreement before the end of the fixed-term. If it doesn’t include this clause, then you can't end the tenancy early unless your landlord agrees to it.

If you decide just to walk away, you'll still be liable for the rest of the rent to the end of the contract period.

If you've gone beyond the fixed term, then your agreement will be a periodic tenancy ie rolling from week to week or month to month.

In this case, you normally have to give at least four weeks’ notice to end it, or a calendar month if you have a monthly tenancy.

The main exception to this is if your landlord agrees to accept a shorter notice period, or agrees that someone else can take your place.

It's always best to give notice in writing and ensure that the notice ends on the first or last day of the period of a tenancy. 

For example, if your tenancy is monthly and started on the fifth day of the month, the notice you give your landlord should end on the fourth or fifth.

The Department for Communities and Local Government has produced a How to Rent guide, which includes some useful tips for both landlords and tenants.