Random reboots macbook pro late 2008
Troubleshooting is often a process of elimination, so patience is often required. There's quite a few things you could do to try and narrow things down, because even from the info you've provided the cause could be RAM, your battery, or something else altogether.

For example, if it works fine in Safe Mode then it's more likely to be some sort of software issue/conflict.

To start with I'd do a NVRAM and SMC reset (in that order) as there's really no harm in trying that first. Before following the steps below, ensure you have no external hardware connected and that you're using the built-in keyboard.

Reset the NVRAM

Reset the NVRAM on your MBP as follows:


Shut down your machine. Yes, a full shut down, not just logging out.
Press the power button and then press the commandoptionpr keys. You have to make sure you press these keys before the gray screen appears or it won’t work.
Hold those keys down until your MBP reboots again and you here the startup chime a second time.
Let go of the keys and let your MBP reboot normally.


Note: When you log back in you may need to readjust some of your system preferences (e.g. speaker volume, screen resolution, startup disk selection, time zone information, etc).

Reset the SMC

To reset the SMC on your model MBP, follow these steps:


Shut down your MBP
Disconnect the MagSafe plug (power cable) from the computer
Remove the battery
Press the power button for 5 seconds and release
Put the battery back in
Reconnect the MagSafe cord (or power cable)
Turn your computer back on with the power button


After resetting both the NVRAM and SMC, use your computer to determine if the issue still persists. If it does, I'd test your hardware as with Apple Hardware Test.

Run Apple Hardware Test

Your model MBP uses Apple Hardware Test. To use this, follow these steps:


Shut down your MacBook Pro 
Restart your MacBook Pro
Press and hold the D key before the gray startup screen appears.
After a while, Apple Hardware Test (AHT) will start.
When prompted, select your language and click the right arrow. 
When the AHT console appears, you can choose to run Basic tests by clicking the Test button. However, I suggest you select the "Perform extended testing" checkbox before you click the Test button.
Your test results will appear in the window in the bottom-right of the console.


Note 1: that the extended test will take some time. Take a note of the results and report back. 

Note 2: If pressing and holding the D key at Step 3 doesn't work, start again at Step 1 and, at Step 3 press and hold both the OptionD keys instead. This will try and run diagnostics from the internet instead, so you will need to allow more time for it to complete.

If your MBP passes all hardware tests, then I'd try using it in Safe Mode.

Boot into Safe Mode

Follow these steps to boot your MBP into Safe Mode:


Fully shut down your Mac
Restart your Mac
Immediately press the Shift key and keep it down 
Let go of the Shift key when you see the login window (NOTE: If you have FileVault enabled you may need to log in twice).
Take a note of what happens (i.e. can you use it without it restarting)
Exit Safe Mode by restart your Mac as normal and test again


If you find that your MBP works fine while in Safe Mode, but not when booted normally, then let me know and I'll explain the process of identifying the culprit (it's likely to be a login item, corrupted font, or kernel extension).