I have had several PC's (which was self assembled) which restarts at randomly. It is mostly for office use, so I doubt that it has something to do with overheating. Could it be something I do wrong while assembling it? Or could it be just faulty RAM something like that?
Being for use as an office PC does not rule out the possibility of overheating. Airflow through the case, proper contact between the CPU and heatsink, and the fan working are things to look at. If you do remove the heatsink, clean it and the CPU off with isopropyl alcohol and then reapply a paper-thin layer of thermal paste before reinstalling the heatsink.
Also, tie extra cabling out of the way, as it can impede airflow through the case.
Lastly, check for dust, as that's another thing that can hurt airflow.
To check for RAM, snag
Memtest86 for floppy or CD and just boot off that. Let it run for a few hours (unless you start getting errors).
Lastly, if those don't work, you may have some bad power supplies. I think it's probably to do with the first options, but it can't be ruled out. Do the first two since they're the cheapest options.
As far as installing it wrong, it could be done, but you'd have damaged the parts. CPU's are designed to go into the socket a specific way, and if you did manage to force it in the wrong way, you'd fry the CPU, not to mention damage it.