Welcome to forum Faith. The 520 is indeed a great phone, especially for it's price. There's a few things you could try, to see if you can get this problem sorted. But as it's only 2 months old, if you purchased it New, it should be covered under warranty anyway. So if all else fails, you may well be able to send it in to get repaired or get a replacement.
What I'd do first, is check that the battery is seated correctly. Pop the back cover and take the battery out. Make sure the battery contacts are clear from any dirt/dust etc (don't use water or liquids though) and then firmly put the battery back into the phone and put the cover back on. Test to see whether the phone now works correctly.
Also, when the phone decides it wants to switch off, what is the battery level like? Is the battery going flat, or can the phone still decide to power itself off when the battery is full?
How are you charging the phone as well? Do you connect it to your PC/Laptop, or do you connect it to the wall charger?
There is always a Hard Reset you could try. Although I probably wouldn't try this yet, if your phone is not lasting any more than a few minutes, as it won't have time to complete the reset. This method basically wipes your phone to factory defaults (including all you data, so you'd have to make sure you have everything backed up). If it is a software issue, a Hard Reset would usually fix it. It does sound more of a hardware issue to me though. Let us know how you get on with the battery removal etc.