A black object, like a t-shirt, looks black because it absorbs all the wavelengths in white light and reflects none. As the shirt absorbs all the light coming from sun and other forms of light also, the energy carried by that light doesn't just disappear into the shirt, never to be seen again. Instead, as the light is absorbed, it gets converted to other forms of energy, usually heat, and then emitted by the shirt. The darker the object, the better it emits heat, because it’s a better absorber of light.
On the other hand, a white object appears white because it reflects all the different wavelengths and absorbs little to no light. It doesn’t absorb much energy, then, and puts off little to no heat.
Your body on its own is a source of heat which is a lot closer than the sun is. When all that body heat hits the white clothing covering it, it gets reflected right back towards the body. When we wear white, we cook ourselves. Again black also absorbs energy from the body instead of reflecting it back.
So, the white clothing on body keeps the body heat intact and the black clothing on it works as a double shield by absorbing outside source of heat and both together traps the heat inbetween and keep you warm in cold countries.