100 RPM minus your age. (Only half kidding.)
80-90 RPM is a good target for younger, fairly serious bikers. When I was in my 20s-30s I could do that for several hours. As I get older (I'm 63) I find it harder -- 70 RPM is probably closer to my "optimal" speed now, and I drift down toward 60 if I don't keep at it.
One rule I tell folks that I think is good for almost all environments, whether flat-out or casual, uphill or down, is to never pedal slower than you're breathing. Keep your cadence at 1-2x your respiration rate.
If you're riding along lazily with a resp rate of 30 you can get away with a cadence of 45, but if you're resp rate is 60 your cadence should be at least 60, maybe 80-90.
Similarly, if your cadence is 90 and your respiration rate only 40 then you should be using a more difficult gear.