When a digital camera makes an exposure the imaging chip (whether it's CCD or CMOS) records the amount of light that has hit each pixel, or photo site. This is recorded as a voltage level. The camera's analog to digital circuitry now changes this analog voltage signal into a digital representation. Depending on the camera's circuitry either 12 or 14 bits of data are recorded. Incidentally, if the camera records 12 bits of data then each pixel can handle 4,096 brightness levels (2^12), and if 14 bit then it can record 16,384 different brightness levels (2^14). (To my knowledge no current imaging chip records a true 16 bits worth of data).

Of course what happens after you've taken the photograph depends on whether you have the camera set to save images to the memory card as raw files or JPGs.

If you've saved the file in raw mode when it is subsequently loaded into a raw conversion program and then saved to a TIFF or .PSD format file it can be exported in 16 bit mode. The 12 or 14 bits recorded by the camera are then spread over the full 16 bit workspace. If you've saved the file in-camera as a JPG than it is converted by the camera's software to 8 bit mode and you will only ever have 256 brightness levels to work with.

I took away from this that unless you are going straight to print or web, you should refrain from saving and re-saving to JPEG files. The tutorial contains quite a bit more information on using RAW files, so I suggest giving the entire article a read.