I'm not sure, but I believe that it lasts until midnight unless the infected pokemon is in the PC. Either that, or it lasts 24 hours. It will last forever as long as the pokemon is in the PC.
You'll have to look it up if you want a definite answer. I apologize.