Power Surges Problem with Computer

Hi, my computer is having some power supply problem cause when i open up my homework on my computer it will run it and then after a couple of minutes of running it my computer shuts down and then boots right up and and then tells me power surges detected in the power supply unit, which is weird because i could play battlefield 4 all night without a problem but when i open my homework it just throws in the towel, Ill be honest i don't know what this means i seriously need some help cause i don't want my computer to completely break on me, so please some one help me please and thank you and here are my specs:

Case: Cool Master Storm Styker

Motherboard: Asus Sabertooth Z77 

RAM: 16 GBS

GPU: Nvidia Geforce GTX 670

PSU: i don't know, sorry

       Drives: i have two a samsung SSD ans another one that i dont know what the brand is all i know its a tera byte of memory, im sorry with some things its very vague but i had a friend build me this PC so yeah

If you're not too savvy with it get your mate who built it to have a look - bad psu most likely or, a shitty or loose cable, a faulty ssd. Loads of things. Failing that take it into a store.

If it is the psu at fault invest in a good quality unit from a reputable brand -  Seasonic, XFX, Corsair, Antec HCG's, Silverstone, Superflower. A 650w or thereabouts would be fine.

Thank you for the advise, but i found out what was wrong, again thank you for the reply