All other things being equal, what is the difference in power consumption of iMac with 8GB of RAM and iMac with 16 GB RAM?
It depends on which model of iMac it is as the various models have differents types of RAM - for example DDR2, DDR3, LPDDR3 and LPDDR4. In particular make note that some models use LPDDR RAM, where the "LP" stands for Low-Power.
The latest mid-2017 iMac uses PC4-19200 DDR4 SO-DIMM RAM modules. Here the difference in power usage between 8 GB and 16 GB is approximately 3 watts.
The difference between in power usage in having 1 x 16 GB, vs 2 x 8 GB, vs 4 x 4 GB modules is negligible.
Note that the mid-2017 27" iMac consumes about 217 watts when the CPU is maxed out, so the RAM power usage is very small compared to the rest of the system.