Computer keeps on shutting down

Hello Everyone,
I have this big computer problem that I can't seem to figure out at all. My computer is only a year old and I do not keep it open for more than 8-10 hours a day. But recently, it keeps on shutting down randomly, within an hour or two. Though, it doesn't give me any trouble after that I just find it very weird and sometimes frustrating especially when I am in the middle of an important work. It happens once everyday. Can somebody explain to me what's going on,please? Thank you very much!
