I already had a similar problem before and after more than two years of struggling (I had this problem long since the Yosemite) I am still being daily annoyed by the same problem.:
However this time it is slightly different. The thing is, it newer "randomly shut downs" while I'm on Windows, doing stuff, playing games, etc. - it only happens on Yosemite, and it is a fresh copy on the new SSD and all that. Therefore, I really don't think it's a hardware problem. There is even nothing in the logs at that time (???)
After I installed the new Yosemite OS with Boot Camp (Windows 8.1 Pro) on my brand new Samsung 840 EVO 1TB SSD, my MacBook Pro randomly froze and after a few minutes - shut itself down.
I even thought it could do something with my USB ports, because of this (only a few keys worked on login when external USB hub with Yeti mic plugged in): Some keyboard keys are not working on login to Yosemite but after some more testing, I can rule that out. It's reproducible with no devices connected over USB.
This problem occurs more frequently when I'm watching videos or working with Photoshop and Illustrator at the same time but sometimes it's totally random (but then, why it's not shutting down when I'm playing games on Windows?) I thought this could be a GPU issue, so I installed gfxCardStatus, but no luck here.
Could this be an "Automatic graphics switching" issue or is it something else?