It depends on cause
Most viral gastroenteritis
last an average of 3 days, some may last up to a week.
The most important thing to consider is how well hydrated the child is, and if the child is able to keep fluids down.
Be familiar with signs of dehydreation and consult your docor.