If you really want a correlation measure then with a 0-23 scale I would say that you would be OK to use Pearson's.
However, I'm not sure that you should be looking for any correlation measure here. Correlation is a measure of linear association. If I have understood the question, then it is seems likely that you are dealing with a non-linear association. The time variable goes from 0 to 23, but the ambient measure presumably increases and then decreases. Correlation will not capture that.
I would suggest a different approach, that of regression. For example you could consider ambient light as the dependent variable, and hour of day as the independent variable. You could then allow for nonlinearity by introducing a non-linear term such as a quadratic. This is only an example, the subject domain knowledge would presumably offer some insight as to the actual nonlinear asociation to use.