As a rule your deposit is returned within 4 to 8 weeks, depending on your contract version, after the end of your contract (not date of moving out).
In individual cases there may be delays in payment. This is especially the case if an unreported deficiency is noted in your room. In this case, the payment of the security deposit only occurs after completion of all measures required to correct the deficiency. A pro rata payment of the deposit during this operation is not possible.