Sigh. There are 8 distinct eras of iMac each of which take different RAM.
You have to be more specific.
And for future reference the answer to this and many other repeatedly asked questions, is in the Guides : Hardware:
Understanding Intel Mac RAM
Assuming you are talking about an intel iMac, there are four categories:
CoreDuo machines take 667 MHz RAM limited to 2 GB ( 2 x 1 GB SODIMMS)
White Core2Duo machines take 667 MHz RAM up to 4 GB ( 2 x 2 GB SODIMMS) but will only utilize 3 GB of that total
Aluminum SantaRosa Core2Duo machines take 667 MHz RAM up to 4 GB
Aluminum (April 2008) Core2Duo machines take 800 MHz RAM up to 4 GB
There is no point in installing 800 MHz RAM in a 667 MHz machine, it won't make it go faster and it may crash the machine.
There is no point in installing 667 RAM in a machine that requires 800, if it works at all, it will slow the machine down.