Depending on the cause, a child may pass green stools for a couple of days to weeks. For instance, green poop caused by ingestion of green-colored foods, such as spinach, resolves by itself. On the other hand, green poop caused by infection would require treatment, after which the stool color will return to normal.