Primarily, if the safety of your king can be an issue, castle. It usually is an issue, and it takes some experience to see an exception. Keep in mind that castling develops the rook so even if king safety weren't the principal reason, development probably is.
To Castle or Not to Castle?

There are really only two circumstances in which I would consider not castling and they both are related.
1. There are not enough pieces to mate the King left on the board. The King is a fighting King and we are entering the endgame or late middle game stages.
or
2. Castling poses more threats to King safety than not.
You can avoid lots of problems by castling quickly. There are however, some opening lines deep in theory where the King stays in the center. I would not casually make the decision to stay in the center of the board.
My experience has been if I haven't castled in the first ten moves, then I am either already in deep trouble or my opponent is near mate himself.
Although I have known the rules for many years, I have only recently started playing chess properly and am still very wet behind the ears. I notice that often players castle as soon as they can more or less. I understand that this is to protect the King and centralise and link up the Rooks. However, there are also occasions when I feel that perhaps, as the game goes on, if I haven't yet castled, perhaps I shouldn't.
Under which circumstances therefore, ought one choose not to castle?
Many thanks in advance,
Horatio