The tenant and the landlord will negotiate this up-front. The amount of deposit due will be written in the lease agreement.
The landlord is entitled to negotiate whatever deposit he / she deems fit. It is common for the landlord to require one month’s rent or a double deposit (2 month’s rent). The landlord could even require a triple deposit if the tenant's credit report is considered risky.
However once the amount of the deposit has been agreed, the landlord cannot demand a bigger deposit during the term of the lease – unless the tenant agrees, or the lease agreement makes provision for a top-up when the rent increases
Practically, the landlord should not hand over the keys to the property until the agreed deposit and first month’s rent has been paid (and cleared in the case of a cheque).