Security deposit

I think I've heard that a law's been passed preventing a landlord from keeping your security deposit for wear and tear of an apartment.

Can you give me any information on this or point me in a good direction.

I have still got another year on my lease but I want to start planning ahead.