Rayleigh Criterion

The diameter of the smallest disk that a lens can produce as image of a point size object is called Airy-disk

According to the so called “Rayleigh Criterion” holds:

The smallest possible Airy-Disk that a (diffraction limited) lens can generate is

D = 2 * 1.22 * Wavelength * F\#

The best possible resolution on image side (at 20% contrast) is the radius of this smallest possible Airy-Disk

R = 1.22 * Wavelength * F\#

When you double the F#, you lose factor 2 of resolution in each x and y direction.
If the lens supported 5 Megapixel before, then it supports only 1.3 Megapixel after
When you double the wavelength (for example 850nm IR instead of 420nm blue), you lose factor 2 of resolution in each x and y direction. If the lens supported 5 Megapixel before, then it supports only 1.3 Megapixel after

See F-number