Over long stretches of play, the muscles around your eyes fatigue, and that shows up as a dull ache rather than anything dramatic. It is strain, not injury.
The fix is boring and effective: take breaks periodically. In my own experience the single best remedy is looking out a window at something far away on a regular basis. Focusing at a fixed near distance for hours is what causes the problem, so deliberately shifting your focus to the horizon resets those muscles.
As a rough guide, sessions under about 45 minutes are unlikely to cause any lasting discomfort. Beyond that, the ache tends to creep in, and that is your cue to look up.
It is worth separating this from the older myth that screens permanently damage eyesight. There is no good evidence for that. What screens do cause is temporary strain and dryness — partly because people blink noticeably less when concentrating — and both of those resolve with breaks. Dim, uneven room lighting and a screen much brighter than its surroundings make the strain worse, so if your eyes are consistently sore, look at your setup before blaming the game.