Apple doesn't sell 27" iMacs any more – just 24" ones (successors to the old 21.5" models).
The current 24" M3 iMacs use the same 'base' M3 chip as some of the entry-level 14" M3 MacBook Pros. For this chip, the RAM choices are 8 / 16 / 24 GB, and for both systems, there's a limit of one external display. Since Adobe recommends 16+ GB of RAM for Photoshop, Lightroom, and Lightroom Classic, I would not get only 8 GB if I knew, right off the bat, that I might be making heavy use of Adobe photo processing programs.
Systems based on higher-end M2 and M3 chips may offer different RAM choices, more ports, and support for more displays. For example,
- The M2 Pro version of the Mac mini has 16 or 32 GB of RAM
- The M2 Max version of the Mac Studio has 32, 64, or 96 GB of RAM
You may find that things like
- Port selection,
- Maximum number of displays, and
- The nice 4.5K Retina screen on the 24" iMac
weigh into a decision more than the question of whether to get 24 or 32 GB of RAM.
You also might decide that for your intended usage, 16 GB would be "good enough."