I have been riding a folding bike in the past. I have never replaced its chain.
Recently, I have bought a second handed road bike for $500. I am afraid of the chain breaking suddenly.
How do I know I should replace the chain in advance?
The most common way is to use a "Chain Wear Indicator Gauge" tool. (google for product pages).
If you don't have access to (or don't want to buy) one, you can use a ruler: http://sheldonbrown.com/brandt/chain-care.html