The honest answer is that the effect depends almost entirely on how much time they take. Games do not lower grades by some mysterious mechanism; they lower grades when they displace the hours that would otherwise go to homework, revision, and sleep. A student who plays for an hour after finishing their work is not in the same situation as one playing until two in the morning.
Research on the subject is mixed, and most studies find correlation rather than a clean cause. Heavy gaming often coincides with other factors — poor sleep, low supervision, disengagement from school — that do their own damage, which makes it hard to pin the outcome on the games alone.
The practical takeaway is about boundaries rather than prohibition. Fixed homework time first, a hard stop before bed, and games as the reward rather than the default tend to preserve both the hobby and the transcript.