I've been having this problem for quite a while, whenever my PC automatically goes into sleep mode (30 mins in my case), Windows crashes, and my PC reboot, I know this because when I log back in, all my programs and windows were closed, and Chrome report an unexpected shutdown (or something like that).

I checked the Event Viewer, and it seems I have Event 41 (Kernel-Power) problem, I've been searching for the solution for the past few months, but no luck of solving this particular problem.

Specs: (None of these components are overclocked, I've never overclock this system before either.)
Windows 8.1 Pro (64-bit)
Core i5-4690K @ stock clock
Gigabyte Z97-UD3H Motherboard
GTX970 @ stock clock
8GB Kingston HyperX Fury 1866MHz @ stock clock
250GB Samsung 850 EVO SSD

I, however, solved the problem that my PC would behave the same when I manually put it into sleep (Start -> power -> Sleep), so now my PC goes into sleep and waking up just fine if I manually put it into sleep.

TL;DR: Windows 8.1 Pro crashes and PC reboot when it automatically enter sleep mode, but it's fine if I manually put into sleep mode.