Color depth refers either to the number of bits used to indicate the color of a single-pixel, or to the number of bits used for each color component of a single pixel.
For consumer video standards, such as High-Efficiency Video Coding (H.265), the bit depth specifies the number of bits used for each color component. When referring to a pixel, the concept can be defined as bits per pixel (bpp), which specifies the number of bits used. When referring to a color component, the concept can be defined as bits per component, bits per channel, bits per color (all three abbreviated BPC), and also bits per pixel component, bits per color channel or bits per sample (bps). Color depth is only one aspect of color representation, expressing the precision with which colors can be expressed; the other aspect is how broad a range of colors can be expressed (the gamut). The definition of both color precision and gamut is accomplished with a color encoding specification which assigns a digital code value to a location in a color space.
With the relatively low color depth, the stored value is typically a number representing the index into a color map or palette (a form of vector quantization). The colors available in the palette itself may be fixed by the hardware or modifiable by software. Modifiable palettes are sometimes referred to as pseudocolor palettes.
Old graphics chips, particularly those used in home computers and video game consoles, often have the ability to use a different palette per sprites and tiles in order to increase the maximum number of simultaneously displayed colors, while minimizing the use of then-expensive memory (& bandwidth). For example, in the ZX Spectrum, the picture is stored in a two-color format, but these two colors can be separately defined for each rectangular block of 8x8 pixels.
The palette itself has a color depth (number of bits per entry). While the best VGA systems only offered an 18-bit (262,144 colors) palette from which colors could be chosen, all color Macintosh video hardware offered a 24-bit (16 million colors) palette. 24-bit palettes are pretty much universal on any recent hardware or file format using them.