Check to see if your sleep mode has changed. See this article:
http://www.macworld.com/article/53471/2006/10/sleepmode.html
(It's rather old, but it's still accurate for OS X 10.6 sleep modes)
To summarize, open a "Terminal" window (in the Utilities folder) and type "pmset -g" ('pmset' manages power management settings) This will display your current settings.
Check the 'hibernatemode'. The default mode is '3' for laptops. If your Mac is using anything other than 3, then this could be why it seems to just power off (especially if you are set to mode 1 or 5 -- which will completely power off the system after saving the state of RAM to a hard disk file.)
If you are not using mode 3 and want to return it to mode 3 then type the following command in the Terminal window:
sudo pmset -a hibernatemode 3
You must have administrative permissions on the mac (a non-admin account can't make this change) and you will be prompted to type your login password.