Too many ways this can happen. you can try to pinpoint the issue by checking what the crush dump shows. i have used Bluescreenview to see what was at the top of the heap when Windows crashed
Assuming the hardware is NOT the problem and the issue shows up sporadically, i would make sure you have the latest BIOS and drivers, and Windows updates
I recommend the use of HP SDM ( Softpaq Download manager - www.hp.com/go/sdm ) to update the system. When it runs and downloads the latest catalog,
* select 'check for updates' tab - if not the default when you run SDM
* install auto-checkmarked drivers, NOT the BIOS, at this point
it may occasioanly suggest 2 versions of dirvers - select the latest one only
* install any other (ONLY) drivers that show as Not Installed + Essential System Updates softpaq
* select BIOS update (if needed) by itself and Install
DO NOT SHUTDOWN if the laptop beeps a few times during the BIOS update !!! Let it continue to final Reboot