Sounds like your laptop is overheating and shutting down to prevent any damage could you find out the temps on your laptop while on idle and gaming and make sure that the fans on laptop are not blocked or dusty. But sounds like everything still works but overheating issue so would try buy an cooling pad for your laptop