In general, it takes around four weeks for the worms to get eliminated from the dog's body. However, the exact timeframe depends on the type of worm and the dewormer's efficacy. The severity of the infestation plays an important role, too - weaker infestations tend to clear faster than strong ones.