The common mode range definitely matters at DC as well as AC.
Looking at the TI TL072 datasheet, the supply voltage is rated for either 10-30V or 4.5-40V depending on version, the input common mode range is V- + 1.5V to V+ (V- + 2.5V to V+ - 1.5V for best CMRR), and the output voltage range is V- + 1.03V to V+ - 0.965V under the worst case datasheet conditions.
This is definitely a part that was meant for dual power supplies. If you power it with V+=+5V and V-=-5V it should do just fine for your 0-3V signal with plenty of safety margin.
It has a worst case input offset voltage of +/-5mV which will add a small error to your measurements.
If you only want to use a single 5V supply, not dual supplies, then you will need to look for a different op-amp with an input voltage range that includes the negative rail. The LM358 running on 5V has an input common mode range of 0-3.3V and can provide output down to 20mV (with the load resistor pulling down instead of up), but it has a higher input offset voltage of up to 9mV.
Of course, there's tons of better options amps available if you order them online, but the two you have available are cheap and common.