Time Machine is the built-in backup that works with your Mac and an external drive (sold separately) or Time Capsule. Connect the drive, tell Time Machine to use it, and relax. Time Machine automatically backs up your entire Mac, including system files, applications, accounts, preferences, email messages, music, photos, movies, and documents. But what makes Time Machine different from other backup applications is that it not only keeps a spare copy of every file, it remembers how your system looked on any given day—so you can revisit your Mac as it appeared in the past. Time Machine keeps hourly backups for the past 24 hours, daily backups for the past month, and weekly backups until your backup drive is full.
Setting up Time Machine Backups to an External Hard Drive
Setting up Time Machine is as easy as connecting an external drive to your Mac via Thunderbolt, FireWire or USB. You can also use a secondary internal drive if your desktop Mac has one (that is, a drive that you don't start up from).
If you haven't specified a Time Machine backup device yet, Time Machine asks if you would like to use the disk for backups the first time you connect it.
Click "Use as Backup Disk" to confirm you want to use the drive for Time Machine backups. Time Machine preferences will then open with this drive selected as your backup destination.
That's all you have to do for Time Machine to automatically backup your Mac.
About the first backup to an external drive
You may want to set up Time Machine in the evening so that the initial backup can be done overnight because it may take a while depending on the size of your OS X volume. You should not interrupt the initial backup. You can continue to use your Mac while Time Machine backs up.
Once the initial backup is completed, Time Machine performs subsequent hourly backups of only the files that have changed on your Mac since the last backup (as long as your backup drive is connected).
Tip: You can manually initiate a Time Machine backup cycle at any time by choosing Back up Now from the Time Machine menu, even if you have Time Machine preferences set to off.
More information about Time Machine and how to use it can be found here.