External Disk Capacity for Time Machine
The Time Machine drive should be equal to or larger than the drive that it backs up. TM images the drive completely, then saves incremental changes. Time Machine saves the hourly backups for the past 24 hours, daily backups for the past month, and weekly backups for everything older than a month.
If your internal is 500GB with 100GB free (using 400GB), and your TM is 500GB, then you will get a full image, and then some amount of history (filling up the remaining 100GB of the TM disk). The history length depends on your use habits.
- Change a few small files occasionally? Lots of history.
- Change lots of big files a lot? Then the 100GB free will save a few hours or days.
If you have a bigger TM, you will have a longer history to browse.
I personally have a mostly full internal, an equal sized TM, and change files quite often, and find that I usually have a few months of history. Plenty of time to restore a file I accidentally delete.
There isn't much to add over the previous answers, but I would mix them a bit.
Your Time Machine drive should be at least as large as the internal one. I've read somewhere a recomendation of it being 1.5 to 2 times the internal drive, but that actually depends on how you use your machine. If you deal with lots of small files, 1.5 will probably do. If you deal with video, and keep them in your internal drive, at least 2 times the internal storage.
Remember that Time Machine keeps a copy of each version of any file changed, so if you change the metatags of a 1.5 GB video file, you will get 2 copies in your TM storage. If you make lots of individual small changes to your music files, they will be stored as different backups as well.
Also, I agree that you should by the largest drive you can afford, and resist the temptation of partitioning it when you see the unused empty storage. I originally had a 250 GB internal drive and a 500 GB TM drive that was ok. I bought a 1.5 GB external drive and moved my backup there. Then I upgraded my internal storage to 500 GB and had to increase my TM storage to 750 GB. Then I found that eventough OS X allows me to change the size of a partition, it isn't able to move the start of a partition. My TM partition was the last one, so I had to use Linux to do that, and since it was a large backup partition I didn't have available storage to backup it. Quite a bit of cold sweating, but everything went ok. I just would avoid repeating that.
Time Machine keeps copies of everything on your hard drive, and all revisions. It doesn't keep multiple copies of the same file when it's not been changed. I'd suggest you want a disk with around twice the capacity of the disk space used on your Mac -- so if you're using 300GB of the 500GB on your iMac, you'll want around 600GB for Time Machine. That will allow you to keep a reasonable amount of history of file changes. But it depends on how many changes you're making to your files.