I will give you the best ignorant answer I can and then refer you to @Jay Hemdal .
Fish don't build up an immunity similar to how we build up antibodies to virus and bacteria. However, it's some who contend that the health of the fish help it to ward off ich infection....and this includes a healthy slime coat. That all said, that is simply my belief, and I'll wait with you for Jay to tell us the truth!
Burgess and Mathews 1995 indicates immunity in some fish for up to 6 months, but it varied by species. I don’t have that paper handy, so I can’t give you details.
As far as I know, this acquired immunity doesn’t have anything to do with building up of the slime coat. Some fish like stonefish, shed their slime coats periodically, and it is thought this protects them against parasites.
Jay