It depends on whether you compute variance or the co-variance for a population using the population data or using a "sample" of the population.
If you are computing the variance for a population then you divide the sum of the squared distances between the elements and the mean over the population size (N). But if you are computing the variance using a sample drawn from the population then you divide over (N-1), where N in this case is the sample size (number of sample points in the sample). By this way you are estimating an over value of the variance assuming that the variability in the original "hidden population" is not completely represented in the (usually small) sample drawn from it.