The basics: If most of the graph shifts to the left, it indicates underexposure, to the right, overexposure. Of course, if you're taking a black cat against a white background, or a white cat against a black background, the histogram will reflect the above situation appropriately, so don't take it as something being wrong with your exposure.
To refine YS's answer a little bit more, histograms which have more bars on the left side indicate a darker picture, while histograms which have more bars on the right side indicates a lighter picture - it does not necessary indicate a under/over-exposure situation (unless all the bars are located on the EXTREME left/right side).
There is no IDEAL histogram as it will all depend on the subject - but try to make sure that there are not many PEAKs (ie bars which shoot off the top of the histogram). A well-balanced picture will look like a gentle curved hill.
The key is understanding a histogram and what it represents, and the rest will take care of itself.
A histrogram represents the distribution of pixels within the image. A completely black pixel will log in at the left end of the scale (usually) where there is a black slider to reflect this (usually). At the other end is where a completely white pixel would register, with a white slider. In the middle is a grey slider where a mid grey pixel would register.
Ideally you are aiming for a good range of pixels from black to white. It shouldn't really matter what the shape of the histogram is as long as the range of values exists from black to white. This totally depends on the image you take. For example, a perfect greyscale will be represented by an ever graph from black to white -- a straight horizontal line with no variation. However, a photo of a black card for example would only have completely black pixels, and hence an almost singular spike at the black end and almost no pixels for the rest of the histogram. Or, a black cat against a black background (concentration of pixels at the darker end) or a white cat against a white background (other extreme). In YSLee's examples you would expect to see a bunch of close-to-white pixels, and a bunch of close-to-black pixels, with not a lot of grey pixels. However if this is instead a peak at black and grey, then you know you are underexposing.
The histogram can be used to help judge exposure on the basis that the average scene has a range of tones from full black to full white. However if this isn't the case, then don't expect the histogram to reflect the full range. If however the image should reflect a full range of tones, but doesn't possess any pixels in either end of the scale, then that indicates under or over exposure as YSLee and Darren point out.
This is an "overexposed" picture and its histogram:
So if you take a look at your histogram after you have taken the picture, and find it's not "ideal" exposure, you can adjust the exposure compensation and take the picture again immediately.
I put these words in inverted commas, because obviously there will be situations where you WANT "over-exposed" or "under-exposed" pictures eg low-key (dark silhouettes) or high-key (all bright and white) type of pictures.
It's also useful knowing you can use Photoshop "Levels" to adjust the histogram.
For instance, the "underexposed" shot had this adjustment done:
Look at where I have moved the sliders - to the "edge of the mountain". This brightens the picture considerably. I have also moved the left slider a little inward, to improve the contrast (make the blacks blacker, so to speak).
Look at how the histogram has changed after I did the adjustment:
I say again, it's not just about left and right. Streetshooter's last picture is not overexposed. If you look at the histogram, if anything it's underexposed. Hence there are no truly white pixels. The spike in the histogram is a result of the multitude of very light blue pixels in the sea, which does not indicate overexposure. Just because there are more light pixels than dark doesn't mean overexposure. Looking at the picture it's obvious there SHOULD be more light than dark pixels.
Streetshooter's trishaw pic is not a good example of an underexposed histogram. It is an underexposed shot, yes, but just looking at the hitogram I would guess his exposure was as good as it gets. There are no completely black pixels, there is a full range of values through to white. If he'd given more exposure, he would have blown out more highlights. That histogram could be a perfectly exposed shot of for example an Indian man wearing a dark blue shirt taken against the same background.
You can only interpret a histogram with reference to the picture! Here's an example:
What I've done is taken a crop of a darker section of a complete range of greyscale. The picture is properly exposed, it's just the darker sections that I want and there is no bright section to the picture. Note, to properly correspond the gradation should be the other way.
Hence a histogram like this is perfectly normal. If you decide that because this is to the left and it's underexposed, then you'll bump it to the right by giving more exposure, but then instead of a dark section of the greyscale you'll end up with the middle sections of the scale instead.
The use of a histogram for helping to judge pictures is really of use mainly at the camera taking stage. Once you reach a colour calibrated post processing flow, you are better off taking visual cues from the image on screen. The little LCDs they put into cameras are not calibrated, and indeed also have different brightness settings, so it's difficult to estimate from that screen if exposure is on target or not. Hence the use of the histogram.
Like I said, it's best to understand how a histogram works and what it represents.