overheating or power supply are the top 2 most likely causes.
get a temp program like others have said, monitor the temps of the cpu, that would be the mostly likley cause of a shutdown. take the side panel off the case, make sure the case heatsinks fans are all functioning, maybe stick a desk or floor fan in front of the open side blowing air in see see if the temps go down that way which they should to some degree try playing games etc whatever is causing it to shut down, if it works fine like that then its is overheating.
if it still fails even though things are running cooler and there is no difference, then your mostly likely looking at a cheap psu that is underpowered for the system or is failing itself.
If it is under warranty then take it back to the store and yell loudly, about their crappy workmanship and dont muck with it too much. they can work out the problem and fix it, since that is their job.
another side note if they did not put the thermal paste properly, meaning they not put enough on there and never got it spread out and did not get air bubbles etc out of it, on the cpu when they attached the hs that can cause massive differences in cpu temps, or they did not clean the cpu hs faces off well enough and there is dirt or dust in there that can cause massive thermal problems also. Or they went really cheap and just used a stock intel hs/fan with that gawd awful therma tape junk.
With a little know how, you can get some artic silver thermal compound, some acetone, some coffee filters, and a can of compressed air and apply your own thermal compound after cleaning and dusting out all the surfaces thoroughly. This works for gpus, cpus and anything that has a heatsink with a surface to surface meeting that is meant to draw out heat. And is almost always much more efficient than anything companies use when you get video cards and prebuilt pcs in general and can lower temperatures to a noticable degree. all these items can be had for 20 to 30 dollars also so it makes it a cheap "upgrade" if you will.
Its not terribly complex you can probably find how tos on net for just about any video card or cpu. But if its under warranty it can void it if you do any kind of "modifications" like this.
Take it farther and you can get aftermarket hs/fans that will move more air, good cpu hs/fan can run you anywhere form 20 to 50 dollars, case fans anywhere form around 3 to 15 dollars or so depending on if you want efficient and super quiet or you just want something that will move a ton of air and dont mind the noise. case fans are pretty easy to swap out few screws find the connector swap it done.
cpu hs/fan naturally is more involved and be a royal pita if your got a tight case, or the mb tray does not have a opening in the back for hs/fans since some cpu ones have back plates that attach to the back of the motherboard. SO in some cases you need to take out the motherboard entirely to put one on and that can involve taking apart the entire pc most likely.
probably more information tan you needed but just take it back maybe some of this will be useful down the road, have the people sold it to you fix it give you a new one that works.