Earthworms breathe through their skin and as long as there's dissolved oxygen available then they can survive. There's loads of dissolved oxygen in an aquarium environment, even in the substrate, which is where your worms are thriving.
As long as your oxygen levels remain high enough for them to breathe then they can live for a long long time. If you have any fish that dig then eventually the worms may get picked off in time, unless your substrate is deep, in which case they may live for months.
I'm not sure what the lifespan is for an earthworm but eventually it will die and that is where problems could arise. Some earthworms can get quite large and a decomposing large dead worm hidden in your substrate could result in a spike in parameters.