That sounds like a hardware problem; Malware wouldn't turn your PC off, because the purpose of most malware is to steal data or use your PC for other purposes without your consent. If your laptop is off, the malware can't do what it was written to do.
It could be a power issue and certain types of workload cause it to shut off, or it could be a cooling issue, and it shuts down when it overheats.
Download CoreTemp and run it to see what temperature your processor is reaching. If it's much above 90C you probably have a broken cooling fan.
http://www.alcpu.com/CoreTemp/php/download.php?id=2If it's not overheating, download Furmark and install it. Furmark is a graphics and cpu stress-test:
http://www.geeks3d.com/dl/show/569The tool you want to use first is "CPU burner" and if it's stable after running that for a few minutes, also start the GPU stress test.
In the unlikely event that your laptop doesn't crash whilst doing any of that, the next thing to check is the eventlog. Just type 'Event Viewer' into the start menu and navigate to:
Event Viewer (Local) >> Windows Logs >> System, then 'Filter Current Log' (on the right panel) and choose just error and critical. You can Google the Event ID code to see what the jargon actually means.