White dwarf cooling sequences II. Luminosity functions