Many causes. Look for associations or recent injury. If doesn't go away and can't be flushed out, then should be checked out. If very young, may need conscious sedation or even an exam under anesthesia.
See a doctor. Eye pain is not typically seen in children. Aside from injuries, significant irritation from allergies, or infections, there are few other causes. Rarely, the need for prescription glasses can cause enough strain for a child to describe it as pain. Any new eye pain in a child should be evaluated by an eye doctor.