Is castling really a good idea?

The main reason behind castling is that you can connect the rooks and move your king to safety. Typically you are going to want to castle within the first seven moves, and if not within the first ten. There is good reason why practically all top level players will castle at some point in their game.

Castling is really important. Players also know how to attack an uncastled king (throw open the center), and that's generally easier than attacking a castled king.
That said, castling as soon as possible may be too much; if there is no attack looming just yet and there are more useful things to do, you can often do them first. But an attack against a king in the center can come deceptively quickly, and they often start with preventing your castling!
Also, if your opponent's pieces are all already on great squares to attack your king once it's castled, or his pawns are obviously ready to strike there, think about castling on the other side. But this is getting too general, it's better to talk about concrete positions since it always depends.
Do you have any example games?

Higher rated players do sometimes delay castling in order to not give away their plans. There are also instances where the center has remained closed but the flanks are open and castling isn't used. Generally though what I've observed is that higher rated players do castle, but not as automatically as beginners. They also know that in certain openings, it is best to castle queenside-the Yugoslav attack by white against the Sicilian dragon for instance. Hopefully someone of higher rating can give a more detailed explanation to you.
Yes, castling is a good idea. If you are coming under attack often while casteled, and the attacks are serious, you are probably doing something else wrong.
1) Make sure you _don't_ move those three pawns in front of the king. When you do they are a weakness for enemy pawns to snag onto and rip your protection open. Do what you have to do to stop enemy pawn from coming at you _before_ you have to resort to moving your pawns.
2) Watch the diagonals. If you are getting smothered by a queen often you have to keep a better eye on those diagonals. Again, try to stop the mating threats on the diagonals without moving pawns.
3) Sometimes you can castle too early. If the center isn't opening, there is no need to castle. If you do castle with a closed center, and your opponent hasen't, she can sometimes use the h-pawn, and her rook behind it, to do some damage. If the center is locked up and your opponent hasen't castled yet, you can wait. But be very careful, the center can open really fast.
4) Make sure you have your fair share of control in the center. It is very hard to launch an attack on the king if you don't have firm control of the center. If you are having a lot of succecful attacks launched at you, it may be because you are neglecting the center. Take your fair share, don't shy away. The center is where the action is.
Hope that helps.

Castling is really important. Players also know how to attack an uncastled king (throw open the center), and that's generally easier than attacking a castled king.
That said, castling as soon as possible may be too much; if there is no attack looming just yet and there are more useful things to do, you can often do them first. But an attack against a king in the center can come deceptively quickly, and they often start with preventing your castling!
Also, if your opponent's pieces are all already on great squares to attack your king once it's castled, or his pawns are obviously ready to strike there, think about castling on the other side. But this is getting too general, it's better to talk about concrete positions since it always depends.
Do you have any example games?
good points

Castle only when it's your best move. If you can win tempi or other advantage by delaying, do that 1st. After an early queen exchange, the king is often (not always) better in the center.

When my Queen is on d2, castling on the queen side creates an instant battery--Queen/Rook on the same file. Often I'll wait to castle on the Queenside until I'm ready to open up the middle with a flurry of exchanges. When the dust settles, I'm often in a good position. Not that this is good in every situation, mind you. Just a nice tactic for a solid strategy.

As a beginner, you should just castle early and have done with it.
As you get better, you can refine the plan.
p.s. I still castle early, often by move four. I rarely find that this is the reason for my losses.

When my Queen is on d2, castling on the queen side creates an instant battery--Queen/Rook on the same file. Often I'll wait to castle on the Queenside until I'm ready to open up the middle with a flurry of exchanges. When the dust settles, I'm often in a good position. Not that this is good in every situation, mind you. Just a nice tactic for a solid strategy.
It also creates an instant tactical target for one of your opponents bishops, which doesn't seem to bother the better players, but man, it bothers me.

Thank you all very much. Great points made and I have learned a couple of things from all this. I think my question has been well answered. Thanks again.

Castle only when it's your best move. If you can win tempi or other advantage by delaying, do that 1st. After an early queen exchange, the king is often (not always) better in the center.
Perfect answer.

Castling really is a good idea and not doing so leads to an exposed King. Castling permits you to get your King to safety and your rook closer to the central files. When to castle is the key issue. Beginners are encouraged to castle as early as possible. However, doing so too early can lead to a loss of tempo in the opening. You need to gain a good central position before castling. If given the choice between getting an additional piece to a good square or castling, hold off on castling as long as the King is no danger. Too many beginners miss a good devloping move because they want to castle as early as possible. It all depends on the opneing position.

Where your opponent castles provides an important clue as to how your pawns should behave. To paraphrase Kmoch: rangers with gusto, center pawns with caution, home pawns, not at all. (According to Kmoch...the c- and f- pawns can be advanced before the question is decided)
The reverse is also true, of course. Where you castle provides important information to your opponent about how his pawns should behave.
When you want to provide this information to your opponent could be a factor to weight in deciding if/when to castle. Sometimes, you might find yourself playing chicken with your opponent.
Another factor that might be considered depending on the situation is the notion that the King becomes a fighting piece in the end game and wants to be centralized.
Because much of opening play is in the center, you will find your central king exposed to attacks moreso then the castled king. I assure you, attacking players drool at the sight of a weak, uncastled king. While castling as soon as you posibly can, you probably lack the judgement to know when not to do it, as this is a difficult skill (I sure don't have it). You should castle quickly for the reasons stated above and in other posts.

Look at all these answers. Hmmm I think it all depends as usual. The stronger the players get the later the castling and the less often... in top level engine games castling is seen as often as not. You can't retreat to dogma sometimes it is good not to castle even in highly tactical open games and sometimes it is good to castle where the center is closed and the flanks are open... it just all depends. As someone above stated, only castle when it is the best move.

I would say clear yourself a way to castle ASAP, but don't actually do it if your opponent is way behind on development (so he/she still doesn't know where to position pieces for an attack!).

Castle only when it's your best move. If you can win tempi or other advantage by delaying, do that 1st. After an early queen exchange, the king is often (not always) better in the center.
GREAT ADVICE !! But the fact of the matter is Begginers lose a hell of a lot more games by not castlings fast enough ! A king caught in the center is usually a quick kill , As a begginner Rapid Developement ( castle early ) and play through and win the center should the goal.
I'm still a beginner, and in every game I faithfully castle as soon as possible as per the prevailing wisdom. However, lately I've been thinking about the real wisdom of castling. It seems to me that virtually everyone who plays chess knows just how to go after a castled king, and I often wind up in worse trouble than if I had left my king where it was to begin with. I would really appreciate some input from other players about this. Do higher rated players castle as often as beginners? And if not, is it because there are better ideas out there?