You gave no info on which desktop Mac ( some are easy to open, others are not). See my signature as a sample for minimum useful info to give. If you need help identifying the machine, download the free MacTracker for your OS:
http://www.mactracker.ca/But---
going with your runs OK for a while (eliminates minimum hardware specs), then messes up, I would guess a heating problem. Clear the vents, blow out the dust bunnies, check the fans and heat sinks ---
Additional RAM always helps, as does a reasonably healthy hard drive. Depending on your OS, you may need as much as 20% available space for temporary files.
Greg
Leopard OSX 10.5.6
12" PowerBook, G41.5Ghz, 1.25G RAM