When your tenancy ends you can get your deposit back, minus any deductions you have agreed. A landlord may ask to deduct sums for tenant damage beyond fair wear and tear. If you don't agree to any deductions then it may go to arbitration.
If a landlord did not protect a deposit in a Government-approved deposit protection scheme you can claim compensation. You can also claim if a landlord protected a deposit more than 30 days after receiving all or part of it. There are a few steps involved in claiming compensation for an unprotected deposit, but in the most serious cases courts have the power to award up to 3 times the amount of the deposit, in addition to the deposit amount you paid.