only when gaming? not random. what are your specs?
what is your PSU? how old is it?
Motherboard
CPU Type QuadCore Intel Core i7-6700K, 4000 MHz (40 x 100)
Motherboard Name Gigabyte GA-Z170X-Gaming 3 (3 PCI-E x1, 3 PCI-E x16, 2 M.2, 4 DDR4 DIMM, Audio, Video, Gigabit LAN)
Motherboard Chipset Intel Sunrise Point Z170, Intel Skylake-S
System Memory [ TRIAL VERSION ]
DIMM2: G Skill RipjawsV F4-2666C15-8GVR [ TRIAL VERSION ]
DIMM4: G Skill RipjawsV F4-2666C15-8GVR [ TRIAL VERSION ]
Video Adapter GeForce GTX 1080 (8 GB)
Disk Drive Samsung SSD 850 EVO 500GB (500 GB, SATA-III)
Disk Drive WDC WD10EZEX-00WN4A0 (1 TB, 7200 RPM, SATA-III)
Power Supply: EVGA SuperNOVA G2 550W 80+ Gold Certified Fully-Modular ATX Power Supply
I bought in August 2016.
Also it only started 1 or 2 days ago. Before that I did unplug my PC completely, as I was cleaning my desk. It was completely unplugged for a couple of days. That is the only thing that happened between the period in which PC was working fine and the situation I am in now.
Additionally, and I don't think it matters as much, but ever since the beginning, the PC would shut down and restart seconds into booting process. As in I would press the power button, the fans would start making noise for 2 seconds, then it would shut down and boot again normally. Didn't ever affect anything besides occasional booting.