When we're happy with the quality of prints at the size we prefer.
The number of pixels affects tonal quality, such as smoothness and transitions, as well as image sharpness. I own a Nikon D800E (36 MP), and its image quality surpasses every digital camera I've used - as found in many reviews - except for a 40 MP Hasselblad I borrowed (larger sensor = better tonal quality).
A good yardstick is to compare the quality of prints from digital with those from scanned film negatives.
Because of the rubbish answers on the web, I calculated from first principles using manufacturers' data the effective resolution of film: 645 medium-format film is roughly equal to 35-40 MP under real-world conditions (colour film like Portra, accounting for signal degradations, the effect of film grain, Hasselblad Flextone or other high end scanner, f/8, etc.), and 35mm film is about 20-25 MP. A flat-bed scanners destroys resolution, reducing it by about half. See
http://www.rangefinderforum.com/forums/showpost.php?p=2254748&postcount=1018 for more info.
So, ignoring MF digital and concentrating only on "full-frame" digital, the best current full-frame cameras can - just - equal the tonal quality and sharpness of low-grain professional colour film up to "small" (645) medium format. We have a way to go before full-frame digital matches the quality of "large" (6x7) medium-format film.
i haven't mentioned small-sensor digital, as the small size and high pixel density degrades image quality compared with larger sensors: the reason why the 40 MP Hasselblad I borrowed blew off my Nikon D800E despite there being only a minuscule 4 MP difference.