I'm using Truecrypt for full-disk encryption of my computer's drives. Is it safe to Sleep or Lock my computer, or would that allow someone to bypass the disk encryption and access the data on the drives as if they weren't encrypted?
Full disk encryption, by necessity, needs the key in RAM to encrypt/decrypt data in real time.
If the RAM is powered off and has decayed sufficiently, it's not possible to get keys from it, and your encrypted data is safe in this situation.
Of course the first and third items are tinfoil-hat level stuff, but to prevent against it you should power your system down completely when you are not using it, and run Memtest86+ or your system diagnostics to clear RAM. At least one security-focused Linux distribution does this before power off, I can't think of the name of it.
Full disk encryption does protect you against someone taking the hard drive out of the system and trying to read it in another system while it is asleep if they don't extract keys from RAM directly, which is an advanced operation.
I posted an answer to a similar question here:
The fact that most current full disk encryption methods use RAM to store the keys makes them only partly secure while the system is running. DMA access via Firewire or PCI bus is a possibility while the system is running and not quite as tinfoil hat as some might suggest. There was a great talk at Defcon 21 regarding the problem and the work being done to try and mitigate it (the slides for the presentation will probably show up on the archives soon, though).
No. as others pointed out, an adversary with physical access to the machine can do almost anything with data in ram.
When you hibernate a computer, it caches active ram out to your hard disk. since the key is in active ram, you are placing your key in a file on your hdd, that effectively never goes away. There are tools designed to break into Truecrypt volumes, which scrape ram for your key, and if your volume is not mounted, it will fall back to checking your hiberfil.sys on windows to see if it was cached to disk during the last hibernation.
FDE is a problem because your key will always be present in ram, and for that same reason, it will always get copied to hiberfill.sys on suspend/hibernate.
see this thread for examples of practical attacks and a fuller explaination: Cracking truecrypt files in minutes? Or just truecrypt harddrives in minutes?