Types of LocksBefore you go to pick your lock out, here's the things you need to know. ALL bike locks are a deterrent more than anything else. Make your bike more of a pain in the ass to steal than the one next to it. The usual recommended amount to spend on locks is roughly 10% of the value of the bike, and I find this to be a really good rule of thumb.
The other thing to know is that people will steal anything not nailed down. Wheels. Saddles. The quick release skewers. It'll mess your day up to come out to a bike with a front wheel missing, and while you can't chain EVERYTHING down, you can certainly take some small logical steps to secure your stuff.
For most of us in the US these are the standard in bike security. A U-Lock is a hardened metal shackle attached to a locking mechanism. Mine can be viewed on any picture of my bike locked up.
For most thieves to defeat these they attempt to do so by popping the lock and the shackle apart, or by using really big bolt cutters. The best way to avoid this is to have a smaller U-Lock - less space for someone trying to pop or cut it it. In my own case, I use an OnGuard Pit Bull in what at the time was called the "Medium" size - big enough to get around most poles, small enough to be a pain in the ass to potential thieves. The link above is the more recent version, but mine is holding up just fine so I haven't felt the need to upgrade.
These provide a similar level of security to U-Locks, particularly the insanely heavy duty ones. The most famous of which is the Kryptonite New York Lock, a 15 pound behemoth. These offer more flexibility than U-Locks in terms of items you can lock a bike to - odd shapes and U-Locks don't party well together. These are also good if you like to coil your lock around a piece of your bike for storage.
That being said, like the one above, these can be insanely heavy to lug around and consequently may be tempting to leave at home. Finding a balance between sufficient security and something so heavy you don't bother bringing it in the first place is a personal call. But a lock is only helpful when you use it, so make sure whatever you choose is something you can live with.
These are the bastard child of all that is security when used as the only form of security on your bike. If you use a cable lock, your bike will eventually get stolen. If you use a cable lock in any kind of high-theft area, your bike will get stolen before you get back from the bar. I used one when I first started riding and didn't know any better - I consider myself VERY lucky to never have experienced theft.
So while they're awful as a primary lock, where these work extremely well is as a backup lock to a Chain or U-Lock. One of the big keys to theft deterrence is just making the valuable parts of the bike a huge pain in the ass to get at. So in my own case, as an addition to the U-Lock through the frame, I run an OnGuard Doberman through both wheels, the frame, and around whatever solid object I'm locking up to. The idea here is if a thief came prepared for one type of lock, there's a backup there they were hopefully unprepared for, and will move on to someone else.
Anywhere there's a market, there are people willing to sell you things. There are loose cables that can be looped around wheels and affixed to a U-Lock, lockable skewers you can put through your hubs, and rear-wheel locks which mount to the frame and simply immobilize the back wheel. Some are more effective than others - do your homework, read some reviews on Amazon before buying to see how well these smaller locks have held up in the real world.
Do's and Don'ts
Okay, so you went and bought some locks! Cool. Now that you've done that, we need to make sure you're using them to your best advantage.
When choosing somewhere to lock up, make it stout, bolted down, and preferably a loop-shaped object in a well-lit area. There's a reason bike racks aren't just tall poles in back alleys. It seems ridiculous, but bikes are OFTEN stolen by simply lifting them over the object they're locked to. If you MUST lock up to a pole, it needs to either be incredibly tall, or have something on the top that you can't get the lock around (for instance, if you have a U-Lock, stop signs are pretty okay despite the fact they're not overly tall).
Use the right level of security for where you are and what you're doing - and be realistic. If you live in a city with a lot of cyclists, a major metropolitan area, or any college campus, you need VERY stout locks. ALWAYS lock the frame to your stationary object. If you lock up nothing else, let it be the frame. If you lock up anywhere overnight, you need stout locks. These are high-theft situations. If you live in a town of 1000 people and are stopping by a coffee shop for a muffin, you can relax a little. Just trust me when I say overkill isn't a bad thing in this area - better to have too much and not need it, than to walk home.