Sounds like the computer is freezing which makes the mouse and keyboard non-responsive.
After you reboot, look at Event Viewer, Windows Logs, System and see if there is any indication in there of what may be causing the problem. Look in the log just prior to when the freeze occurs.
To see event viewer, press
Window key + R, type
eventvwr.msc and press
Enter.
It would also be good to check the temperatures of the components of your computer. Start by looking at what BIOS has to show you immediately after you reboot, then use a program like
HWMONITOR to look at the temps in real time.