When an apartment is rented a rent contract ("Mietvertrag" is signed. This contract contains the particular details of the apartment (the cost of the rent, the size of the apartment, the number of rooms, etc). The rent contract also contains the rights and obligations of the tenant and landlord (period of notice, house pets, etc). Once the contact is signed, both parties accept the contract and are legally bound to the contract. But there are also certain legal rules that limit the validity of certain clauses within rent contracts. Most landlords insist that tenants have a valid bank account.
A deposit ("Kaution") normally has to be paid by a tenant as a financial guarantee in case of damage to the apartment. The deposit is normally 1 or 2 months cold rent and is not permitted to be more than 3 times the net cold rent. The deposit has to be placed in a bank account with interest. The tenant receives the deposit plus interest after moving out of the apartment as long as this occurs according to the terms of the rent contract. The landlord is allowed to deduct money from the deposit to pay for any repairs to the apartment.