Each count coming out of the detector represents a certain number of photons. The ratio of counts to photons is called the detector gain. This is largely fixed by the detector and the electronics, but may depend on, for example, the spectrum of the input photons. The uncertainty on the signal is given not by the square root of the number of counts, but by the square root of the number of detected photons. Since most detections involve 2 or more pixels, errors must be summed in quadrature to estimate to net uncertainty.
All astronomical measurements take place against some background.
This background may consist of a number of components. The background generally must be subtracted from the measurement. For example, if you measure the flux in an emission line, it is often superposed on a continuum, or the image of an object is superposed on a non-zero background. Since these backgrounds contribute counts, and they have an associated measurement uncertainty. Always include the uncertainty when you state a result.