Like the others have said, it could've overheated. Computers turn themselves off when it gets too intense to prevent permanent damage.
But yet again it could be other things, firsts things first though.
Open up your computer and give your fan a clean, make sure nothing is blocking the part of the computer where air comes in and the part near the fan where air is pushed out, if either side is blocked, then the air inside will get hotter and hotter without leaving and cause overheating.
If it helps, don't bother putting the cover back on after you open up the computer, it's not needed and it easier for air to get into the case.
I wouldn't be too worried though, if it's just the odd one time thing, if it happens again after you've done what we've said I'd come back and say so : )