it could be any one of many reasons, and we'll need a bit more information before we can offer any help.
1. How old is the computer?
2. Which operating system is installed?
3. When it shuts down, are you doing anything, or does happen just as much when you're not using the computer?
4. If it happens when you are using the computer, is there any particular pattern - does one action seem to trigger it?
5. After a shut-down, does the machine start normally?