Keeping it clean is as important as lubing it. Dirt/grime acts as a grit like sandpaper. Wipe down the chain when opportunity presents with a rag and WD40. Lube with a proper chain lube every 100 miles or so, and don't buy cheap stuff, it flies off and makes a mess. When you lube, don't just "spray it on," apply it at the rear sprocket where the chain meets the sprocket, this way you're getting the lube right into the chain and between the plates. Do this on both sides. It is also best when the chain is warm, as the metal has expanded and the warmed lube can penetrate better.
Speaking of chains, if you remove it for any reason, remember, the closed end of the master link clip goes the direction the wheel/chain rotates.
Worst thing for your chain, riding in rain/wet...more grit/grime and road salts get on chain...for sure, clean and lube after every wet ride as well as wash, and never spray water or degreaser directly on chain.