Blue screen is a bitch. In my own experience its exclusively been caused by hardware problems -specifically you are running the hardware at specifications higher than its designed for.
So, first things last you need to find out what EXACTLY are the specifications of you system.
RAM can often be a big problem because its the thing people understand the least. People just assume one chunk of 512mb is the same as any other. However they have many different sub-specifications such as RAS, CAS, RAS to CAS delay and shit like that. On hardware forums you will often see someone write something like '512mb RAM 8-3-3-2'
(i think these individual settings are given in ms) which gives the specific figures at which the RAM runs. Now if in your BIOS you may have one setting set to say, 2ms, when your RAM can only handle 2.5ms thus causing your system to become very unstable. This is what caused BSODs all the time in my first machine.
Actually fixing it is not that hard if you know what your settings your RAM runs at. You just enter the BIOS and change the settings (right now you may be thinking 'what the fuck is he talking about'). If you don't know what RAM you have you will have to look in you machine, find the serial code on the RAM and search google or yahoo for it.
However, another RAM related problem could be that you have two sticks in your computer (e.g 2x 256mb) that are not identical pairs. This is another common cause of BSOD, so for the purposes of troubleshooting remove all of your sticks apart from one.
A further cause could be that your CPU is operating at a higher setting than it is able to. Alot of people say that if the CPU gets too hot it can cause BSOD but in my experience they are usually pretty resiliant and this isn't a contributing factor. If it IS CPU related, its more likely to be that there either isn't enough voltage being supplied to it, or that the FSB (Front Side Bus) is set too high. Again, both of these can be changed simply enough in the BIOS but its a matter of first finding out what exactly you have.
Like Piggle said the PSU (power supply) can also be fucking it up. If you have alot of stuff inside your PC then it may not be giving it all the power it needs to run properly.
This IMO is the biggest problem with buying a stock PC from a dealer. You never know exactly what is in it. If you buy every individual component yourself you know just what you getting and what it is capable of doing.
One final thing:- I mentioned before that my first computer suffered from many BSODs as a result of overclocked RAM. This was despite the fact that I myself have never changed the RAM settings (or so I thought). But as it happened I had been in the BIOS before and found a setting called something like 'Aggressive performance' (rather than 'optimal') and this had put severe demands on the RAM (even though it meant that the CPU was performing at the correct speed). Its possible you or the guy you bought it from has activated a setting similar to this in order to squeeze the most out of the system.
This isn't a comprehensive list of causes but it may help you out. I suppose it could also be a software problem but I don't buy into that shit. I have spent alot of time with PCs and suffered many BSODs in the past all as a result of hardware problems. The only time I get them now is when Im experimenting with OCing the CPU and haven't given it enough voltage to cope with the extra workload. Other than that I will happily put my PC up against any console (esp. that doorstop the PS2) in terms of reliabilty. This fucker never crashes.
If everything I just typed sounds like an alien language then ask and I will try and help you out.