short answer : typically 5-8w on average... if you want to be super safe, assume up to 10w for mechanical drives.
A 2.5" mechanical drive will consume a bit less, because the discs inside are smaller and lighter, so the motor doesn't need as much oomph, torque, to keep the discs spinning. So a mechanical 2.5" drive will typically consume less than ~ 4-5 watts.
A SSD will consume much less on average while reading data from the SSD, let's say 1-2 watts, but for those few milliseconds at a time it writes data to flash memory, it can use up to 5-10 watts.
Look at the label on the drive.
A mechanical drive will consume power to keep the motor spinning and for the circuit board. A 3.5" drive will typically use 12v for the motor and 5v for the circuit board. A 2.5" drive will typically use only 5v, for both motor and circuit board.
The hard drive label will tell you the maximum power consumption and from which voltages that power is taken.
For example, see the hard drive label below :
You can see there on the right side of the label by the QR code, it says :
5vDC : 0.6A
12vDC : 0.45A
Volts x Current (A) = Power (watts)
This tells you the hard drive will consume a MAXIMUM of 5w x 0.6a + 12v x 0.45a = 3w + 5.4w = 8.4 watts
This is important to keep in mind because computer power supplies can provide a limited amount of current on each voltage.
For example, a 500w power supply may output 400w on 12v (~33A), but only up to 15A (5v x 15A = 75w) and around 50w on 3.3v
So if you reserve a budget of 10A out of those 15A on 5v for hard drives, you can only install 10A / 0.6A = 16 hard drives in the computer, even though the power supply can provide 400w on 12v and that would allow you to install ( 33A / 0.45A = ~ 70 hard drives)
M.2 SSDs are powered using 3.3v ... you will often see numbers like 3.3v 3A on them .. which is 10 watts. Like I said, reading data from SSD is very easy and consumes little power, like less than 1w, but when you're actually writing data into a SSD, the process of writing bytes into the memory chips consumes a bit of energy.