Praise be to Allah.
The one who buys shares with the intention of dealing in them must pay the zakaah of trade goods at the end of the year, so he should work out their market value and pay one-quarter of one-tenth.
The one who buys shares with the intention of keeping them and benefiting from their profits and not dealing in them, should pay zakaah on the profits. For more information please see the answer to question no. 69912.
If one year has passed, and you still have some instalments left to pay, you have to pay zakaah on the shares regardless of these instalments, because a debt does not affect zakaah, according to the more correct of the two scholarly opinions. This is the view of Imam al-Shaafa’i (may Allaah have mercy on him). See: al-Majmoo’ (5/317); Nihaayat al-Muhtaaj (3/133).
Shaykh Ibn ‘Uthaymeen (may Allaah have mercy on him) said: What I think is more correct is that zakaah is obligatory in all cases, even if he owes a debt that takes his wealth below the nisaab (minimum threshold), except a debt that is due before the year is up, in which case he must pay it off, then pay zakaah on what is left after that. End quote from al-Sharh al-Mumti’ (6/39).
And Allaah knows best.