To add to @Transistor's answer:
The On Semiconductor LM324 datasheet (On Semiconductor) has the following specification with a 5V supply. As you can see the typical maximum output is only 3.5V.
This is because the output stage of the LM324 consists of a double emitter follower giving two VBE drops.
There are many newer opamps that can get within a couple of hundred millivolts of the supply rail, these are referred to as rail-to-rail output.
There is however another issue that is preventing the high output going above 2V: The negative feedback from the opamp through D2 and R33 will force an equilibrium with no light present that looks to be in that 2V region, the opamp never gets to saturation. You don't explain what that feedback is supposed to do. If it is intended to be an adaptive bias level compensation then the resistors values, eg R28, need to be changed. Or that circuit removed and bias the photodetector directly from 5V through a resistor. Or you can just follow the opamp by a comparator to create a proper logic level.
