Your machine can shut down for any number of reasons, some normal. We have determine between "unexpected but normal" and "unexpected but problematical.
If your MBP's battery hits 0%, the HD will shut down automatically; simply plug in your MagSafe adapter to restore the charge. In other cases, Energy Saver may shut down your machine if it's not being used for a certain amount of time; check your Energy Saver preferences to set the times.
Some problems are more problematical. The Power Supply regulates power to your MBP, and you may notice unexpected drops in power if it's damaged.
In short, you may want to visit your local, friendly Apple Store if you notice this incidents. But before doing so, be disciplined in your research, and note when the shut downs occur, and under what conditions. If you can, also log the amount of power remaining in your battery when the problem happened. That way, the Apple staff will be able to read the statistics and figure out the problem more easily.