plants use CO2 during the day - when they make use of light to photosynthesise... O2 is produced by the plants.
At night, the reaction reverses and plants take in O2 and release CO2, so CO2 injection is not needed at night.
The process is more complicated than just an on and off switch but if you let CO2 into your tank an hour after the lights go off, or ten for that matter- it won't be the end of the world.