Really? You're suggesting a virus or malware is powering ON the PC whilst it is switched off? Good grief...
Your PC can only power up from switch off if your bios settings allow for this. Usually this will be a timer setting in the bios, or a capability to switch on due to another condition such as due to an instruction over the local network (LAN) often referred to as a 'magic packet'. All such facility cam be disabled in the bios settings, and cannot be addressed within Windows as Windows is not running at that point.
The power off/sleep timer settings can usually be controlled within the Windows power settings (control panel). If your PC is powering down outwith the remit of these settings, then go and check your bios settings for a power down timer. If there is no such setting (or it is not enabled) then check to see if something is overheating or if there's a power issue causing your PC to shut down. Keep I'm mind, other software on your PC can trigger a shutdown if set to do so. Take a look and see what you can find.