Please be more specific about the model in question... is it a x360 830, 1030, 1040... and what generation, G5, G6, etc.?
in any case, this is often a Windows power management issue... i would first make sure you update the BIOS and drivers with HP Image Assistant... then make sure you install/update the HP System Default Settings softpaq, which puts a more sane power management profile - as tested by HP - on your system... then make changes to timeouts as needed
I work for HP. However, all opinions and comments are my own.