One of the conditions of it being obligatory to pay zakaah is that one should have full possession of the minimum amount (nisaab) and some scholars say that he should full control of it; money to which the owner does not have access is not subject to zakaah because he is not in full possession of it.
It says in al-Mubdi‘ (2/166) concerning the conditions of zakaah being obligatory:
… (4) Full possession, because incomplete possession is not a complete blessing and it [zakaah] is only due in return for a complete blessing, because full possession refers to what he has in hand, to which no one else has any right and he may dispose of it as he chooses and the benefits of it all come to him. This was stated by Abu’l-Ma‘aali. End quote.
Based on that, if the money in the bank is not accessible to you and you cannot withdraw it, then no zakaah is due on it, even if the money remains in the bank for several years. It comes under the same heading as wealth that is missing or has been stolen or taken by force.
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said: It [zakaah] is not due on a debt owed by one who is in difficulty or one who is taking too long to pay or the one who denies (that he owes anything), or wealth that has been taken by force, stolen or lost, or wealth that has been buried and its location forgotten or wealth when it is not known who has it. This is one report from Ahmad, and it is the view favoured by and regarded as sound by a number of his companions. It is also the view of Abu Haneefah. End quote.
Al-Ikhtiyaaraat, p. 146
It is better and more on the safe side if, when taking possession of the money even if it is after several years, to pay zakaah of one year.
Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him) was asked about orphans who have money in the bank and are not able to access it until after they grow up.
He replied: … Zakaah must be paid on the money of these orphans who are minors, but if it is in the bank and they have no access to it and cannot withdraw it from the bank, then they do not have to pay zakaah during the period in which the bank withholds it, because they are not able to make use of their money, so it is like a debt owed by one who is in difficulty. But when they take it from the bank, they should pay zakaah for one year only.
End quote from Noor ‘ala al-Darb.
And Allah knows best.