How quick a flash of light is invisible
It depends on ambient light, but in darkness, humans can detect as few as several photons, perhaps even down to a single photon (though all detection at these low levels is probabilistic - see Tinsley et al, 2016).

Therefore, this depends on the ambient light (ideal detection in darkness), and the number of photons. At this level of detection, it doesn't really make much sense to think about the duration of the signal: the duration can be infinitesimally brief as long as the intensity is enough to hit the retina with a few photons in the visible range.

A flash of 'darkness' is much different. Introducing dark flashes to a signal that previously had no dark flashes will be perceived as a change in intensity; you can read about contrast sensitivity to find these detection limits. The other attribute that is studied is the flicker fusion threshold which is the frame rate at which a flicker (i.e., alternation of dark and light flashes) can be perceived. The exact frequency of the flicker fusion threshold varies with condition, so there is no single number I can give to answer that question (see Brindley et al, 1966 for some ranges), except to say that it is typically less than 60 Hz for still images and higher frequency for brighter light (that is, if the light is brighter, you detect flicker at higher frequencies) and higher frequencies for moving objects.



Brindley, G. S., Du Croz, J. J., &amp; Rushton, W. A. H. (1966). The flicker fusion frequency of the blue‐sensitive mechanism of colour vision. The Journal of physiology, 183(2), 497-500.

Tinsley, J. N., Molodtsov, M. I., Prevedel, R., Wartmann, D., Espigulé-Pons, J., Lauwers, M., &amp; Vaziri, A. (2016). Direct detection of a single photon by humans. Nature communications, 7, 12172.