The maximum number of colors that can ever be displayed can be calculated:
Tiles: 15 uniques per palette *16 palettes + the common color = 241
Sprites: 15 uniques per palette * 16 palettes + overscan color = 241
241 + 241 = 482
So, 482 colors onscreen at once.
...I don't believe any game ever used this many colors. It'd be the ugliest game ever designed if one did.