Each pixel in a 16-bit/channel/pixel PNG file can be one of 2^48 = 281,474,976,710,656 different colours.
Each pixel in a GIF file can be one of 256 different colours. This isn't quite as bad as it sounds, because each of those colours is chosen from a list of 2^24 = 16,777,216 colours. Provided the image is fairly simple, and the 256 colours are chosen intelligently, and we don't look closely, GIF isn't too bad.
These are limits of the file formats, nothing to do with ImageMagick.
If we are counting colours, pixels in a 32-bit/channel/pixel TIFF file can be one of 2^(32*3) = 79,228,162,514,264,337,593,543,950,336 different colours.