There is no easy straightforward answer. It all depends on the sports.
Here are some guidelines from optometrists:
For contact sports
Imagine a rugby player with glasses in a ruck or maul. How long will a wing's glasses still be on his face after dashing to the try line? It is obvious that contact lenses are a better option than glasses when you play rugby, soccer, hockey or other contact sports.
Optometrists recommend the use of soft lenses rather than hard lenses. "One should not wear something that can cut your eyes if you receive a punch in the face or a bump on the head. It is best to use soft, disposable contact lense while playing a contact sport."
For non-contact sports
When playing tennis, squash or other sports where chances of direct contact are smaller, one can use either glasses or contact lenses.
If you use contact lenses, rather use soft, disposable lenses than hard lenses.
If you wear glasses, use glasses where the lenses are made of durable, unbreakable polycarbonate, not glass.
Increasing numbers of sportspeople now combine their prescription eyewear with some form of eye protection. Consider wearing protective glasses as a matter of course, if possible.
Soft contact lenses are best for vigorous activities, combined with protective goggles where appropriate.
Squash and cricket are good example: goggles may take getting used to, but they protect the eyes, temples and bridge of the nose.
Vigorous sports such as surfing, whitewater rafting, kayaking and boardsailing can causae you to lose you your lenses, along with your swimming costume, toupee and dentures - so consider wearing eye protection of some sort.
If in doubt, ask your optometrist.