it depends on the computer. buying a whole computer will usually be cheaper if you buy a cheap computer. gaming comuters however have inflated prices, and its easy to save several hundred dollars expecially if you have a operating system that you wont have to but, and even more so if you spend the time to learn how to safely overclock. about 10 months ago, i built a computer for $800, that would of cost me at least $1500, probably $2000 whole. also, when you buy whole computers, they often cheap out on psu's and memory sticks, that can cause you problems in the long run; which you can avoid when building your own computer.
but if you was a cheap computer to serf the web and pirate movies/songs, act; a whole computer will probably be cheaper, because the manufacturers get discounts on the items from buying in bulk.
as an example of the customization of building your own computer. when i was building my own computer, i had a 24" monitor with a native resolution of 1920x1200. i knew that having such a large resolution is extremely demanding on the videocard. so i bought the 2nd best videocard on the market at the time, knowing that would be the best way to maximize performance at that resolution; if i bought a whole computer, the only whole computers with that videocard would of been the extreme gamer computers and they would of charged me a huge premium. yet, i spent only $800 on my computer, and my videocard is the bottleneck in most the games i play, and if i spent the $2000+ on a whole computer with that same videocard, the videocard would still have been the bottleneck and it wouldnt perform any better then my $800 computer.