Black is the absence of colours and white is a mix of all seven colours in the white light spectrum, i.e., Violet, Indigo, Blue, Green, Yellow, Orange and Red. The wavelength of this visible spectrum is between 400 and 700 nanometers. When an object appears to be a certain colour - say, red - for instance, it means that the object is reflecting the wavelength of red light (620 to 750 nanometers) and absorbing the wavelengths of all other colours. Moreover, since light is energy, the more light the object absorbs, the more heat it absorbs.
A black object absorbs all wavelengths of light and reflects none and that's why it appears black. Consequently, black absorbs the most heat. Objects that are white, on the other hand, reflect all wavelengths of light and that's why they appear white to us, therefore absorb the least heat.