What do people use for a real time clock?

I'm just getting started with Arduino and plan on using for home automation. Controlling of lights, (turning on at dusk or push a button which starts a timer to turn them off after x minutes), irrigation and for controlling attic fans, etc.

I'm also would like to install door switches so I can see what doors or gates I may have left open.

I've been trying to find out how to max the number of relays I can control ans switch inputs. Anyone know?