In most places, playing video games after midnight is not illegal. Any restrictions would depend on local rules, but there is no general law against late-night gaming.