Time Machine lets you automatically back up your entire system in Mac OS X v10.5 and Mac OS X 10.6 or later. Time Machine keeps an up-to-date copy of everything on your Mac--system files, digital photos, music, movies, TV shows, documents, and so forth. You can easily go "back in time" to restore files if you ever need to.
Setting up Time Machine for backups
Setting up Time Machine is as easy as connecting an external hard drive to your Mac via FireWire or USB, or by connecting to a Time Capsule. You can also use a secondary internal disk if your desktop Mac has one (that is, a disk that you don't start up from).
Note: If you'll use Time Machine with a Time Capsule, skip to "Setting up Time Capsule for Time Machine backups"
If you haven't specified a backup disk yet, the first time you connect a hard drive Time Machine asks if you would like to use it as a backup drive.

Click "Use as a Backup Disk" to confirm you want to use the disk for Time Machine backups. Time Machine preferences will then open with this disk selected as your backup.
That's all you have to do for Time Machine to automatically back up your Mac. 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.
About the first backup
The first backup may take a while. You may want to set up Time Machine in the evening so that the initial backup can be done overnight. If your backup disk is a Time Capsule, the initial backup may be faster if you leave your computer in the same room as the Time Capsule, or use an Ethernet cable to connect your computer to one of the Ethernet ports on the Time Capsule. 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 Mac is awake and the backup disk is connected).
Changing your backup disk
You can manually select a backup disk in Time Machine System Preferences if you want to.
1) Choose From the Apple menu, choose System Preferences.
2) From the View menu, choose Time Machine.
3) Click "Select Backup Disk".

4) Choose a disk where backups will be stored, then click “Use for Backup.”
Note: Every available disk that can be used to store backups is listed. If you’ve partitioned a disk, the available partitions are listed. Time Machine can’t back up to an external disk that's connected to an AirPort Extreme, or to an iPod, iDisk, or a disk formatted for Microsoft Windows (NTFS or FAT format). If you select an NTFS or FAT-formatted disk, Time Machine prompts you to reformat the disk. Choose a different disk or reformat the disk in Mac OS Extended (Journaled) format. Because reformatting erases any files on the disk, only do this if you no longer need the files or if you have copies of them on a different disk.
If your backup disk is on a network, the network server must use Apple File Protocol (AFP) file sharing and both your computer and the networked backup disk should have Mac OS X 10.5.6 or later installed.
The most common format for a Time Machine backup disk is Mac OS Extended format, but Time Machine also supports Mac OS Extended (Case sensitive, Journaled) and XSan formats.
If the disk is partitioned using the Master Boot Record (MBR) partition type, some partitions may not be available for use with Time Machine. The GUID Partition Table (GPT) or Apple Partition Map (APM) partition types are recommended.
Time Machine works best if you use your backup disk only for Time Machine backups. If you keep separate files on your backup disk, Time Machine won’t back up those files, and the space available for Time Machine backups will be reduced.