How long a virus lasts depends on the type of infection and your overall health. Most cases of viral stomach infections resolve within a week on their own.