Here's a quick overview of an often ambiguous piece of gear (or plug-in). Because its use is often misunderstood, it can sometimes be overlooked or misused. Compression can take many forms and be used for a variety of studio techniques. From something as mild as evening out a vocalist or bass player's overly dynamic tendencies (performance, not personality), to heavily affecting (or constructively destroying) an overdub for dramatic color or texture, it's a tool that's as versatile as it is confusing.
Without getting into nitty gritty number crunching, there are some basic functions to note. You'll generally see some incarnation of these controls: threshold, ratio, attack / release, and output (or makeup) gain.
The two primary determining factors of your compressor's effectivity are the threshold and ratio. Threshold determines the level in dbFS (full scale where 0 db is the maximum) at which compression occurs. Whatever level you set (somewhere in the negatives), anything at that and above will be compressed. Anything below is unaffected.
Ratio is a number based on a linear representation of the compressor's tendencies. The higher the number "x" in relation to 1 (the constant), the harder the compressor compresses. Starting low, say 1.5:1, is best. The higher you go, the more artificial your sound will become (this may or may not be your desired effect).
Attack and release adjust how the compressor reacts to the incoming audio signal. Attack is how the compressor hits the signal, release obviously determines how it lets it go. Sticking to slower values here generally sounds much more natural, while going too high can create digital artifacts (unnatural digital noises). Starting below 50 ms on the attack, and around 150 ms on the release are good starting points. Sometimes compressors, especially plug-ins, will have automatic attack and release functions. It won't hurt to give these a shot if you're in a pinch.
Lastly, because your compressor functions in reducing overall sound levels, you can use the output gain as a means to boost the overall signal level that leaves your compressor. Sometimes this is called makeup gain because it is "making up" levels lost during compression.
While compressors have a variety of applications, come in hardware and software formats, and can make or destroy your audio in whatever way you choose to use them, they all have one common task: reducing dynamic range by compressing, or limiting the range of, the higher dynamics. The subtle use of them can really salvage a musician's performance (and ultimately your mix), when it may have seemed destined to live with last week's takeout.