There are numerous ways that evolution can select for specific traits. Evolutionary biologists often describe these sorts of pressures as The Four F's: fighting, fleeing, feeding, and... reproducing.
Others have already mentioned a number of situations describing these pressures in action. Camouflage is likely to be a defensive strategy (i.e. fleeing) though a well-hidden hunter might also find it useful (i.e. feeding). Meanwhile bright plumage might promote social status and/or attract mates (i.e. reproducing).
If you have a desired color in mind, simply imagine a scenario where this coloration would help that creature survive and have offspring by improving it's chances according to one of the Four F's.
However, whatever colorations are favored, those colors will inherently depend on what pigments are present in the organism's skin. Technically, it could alternatively depend on other phenomena (like the irridescence of butterfly wings) but simply assuming pigment==color is probably the easiest way to go, conceptually.
For humans (and lots of other creatures for that matter) the primary pigment is melanin (of which there are actually a few varieties). Biologically speaking, melanin is a pretty simple pigment made up of a few tyrosine molecules oxidised and strung together. These tend to absorb light from a variety of wavelengths, resulting in the mostly brown shades we associate with it for human hair and skin colors. Evolutionary, we all are starting from more or less the same melanin-producing ancestors, so even with a melanin mutation here and there over the eons that mostly just results in different shades of brown- maybe some more rust-colored here or blonde there, but generally from a similar color pallet. Melanin, as a pigment, isn't likely to mutate any blue or green hues anytime soon.
On the other hand, another well-known pigment, chlorophyll is a structurally rather different molecule that does a very similar job (although plants take things a step further, utilizing sunlight rather than just blocking it). At the forefront of the chlorophyll molecule is the Chlorin ring which is like a cage around a single metal ion. In plants, Magnesium is typically found at the center of this ring and that helps to make chlorophyll green. Porphyrin rings are very similar: one natural example is hemoglobin, the red pigment in blood, which cages an iron ion; and a second example is Phthalocyanine which is a bright blue commercially-used pigment which cages a copper ion. The reactions that actually trap the metal ion in the "cage" are typically pretty well selective at putting iron in hemoglobin and magnesium in chlorophyll. Things like altered pH conditions and/or mineral deficiencies, however, can sometimes throw the occasional odd metal into some of these cages- thereby altering the color. It is not too far fetched to think that some alien species may have evolved from an ancestor that had porphyrin-based pigments rather than melanin-based pigments. Furthermore, just as melanin mutations can lead to various hair colors, mutations could lead to preferential uptake of different metal ions and leading to different colors. Aliens don't need to be plants to have chlorophyll-based pigments.
(Bonus points: if pH and/or mineral intake can adjust color expression, then there's a high probability that well-to-do aliens might alter their diet to look more fashionable/appealing.)