Its probably nothing
If it happens anytime you do that its the game that cause problem because some games(like Skyrim) need all the resources of your system and take it hard when you ALT+TAB to Desktop to run music in background.
Also u can pause blue screen and write down the number and google it to find out what it is.
Windows automatically restart in case of system failure but u can turn it of and read the blue screen to find out your problem :
right click on computer on start menu ---- properties ---- Advanced system settings ------Advanced ----- startup and recovery setting ----- then turn off automatically restart --- restart computer to save changes
next time you can read the blue screen error