You may already know this, but just in case you don't, I thought I'd wreck your head by writing it out
The parameters of a compressor affect how it works (duh), and it's very important to know exactly what they do in order to get your desired effect.
Threshold: Sets the level (dB) at which the signal starts compressing. So, if you set your threshold to -20dBFS (probably written as just "-20dB"), when the signal is below -20dBFS it will be left alone by the compressor, but once the signal goes above that level, it will be compressed by the amount you set in your ratio.
Ratio: The amount of compression applied to the signal once it goes above a threshold, indicated by a ratio (funnily enough). So, if you have a threshold of 3:1, for every 3dB the signal goes
above the threshold, there will be a resulting 1dB output. I've seen some compressors where the ratio goes backwards (such as 1:3), and I'm assuming it acts like an "expander" which is the opposite of a compressor.
Knee: This is the one I'm not entirely clear on. Some compressors offer you a setting in dB, other compressors offer a setting of hard/soft knee. If the compressor has a hard knee, then it won't compress until the signal hits the threshold exactly. If it has a soft knee, it will start compressing slightly once it nears the threshold, and increase the amount of compression up to (and slightly above) the threshold. If anybody knows how the "dB" option of a knee works, I hope they chime in and explain it because I want to know
Gain reduction: This isn't a parameter that you can adjust, it's a meter of how much compression you're applying, or in other words: how much you are turning the signal down with compression.
Attack: Sets the amount of time it takes the compressor to start fully compressing once the signal goes above the threshold. It's usually measured in milliseconds, and sometimes it goes down to microseconds. (I'd beware of microseconds, they can sometimes cause clicks and pops when set too short). So, if you have an attack time of 10ms: once the signal goes above your threshold, it will start gradually reducing gain more and more (to the amount you have set) over that amount of time.
Release: Kind of the opposite of attack. This sets the amount of time it takes the compressor to "release" from gain reduction once the signal falls back below the threshold. The release time is normally much longer than the attack time, and I've never seen it measured in microseconds (usually 50 milliseconds up to about 3 seconds). If you have a release time of 200ms: once the signal falls back below the threshold, it will take 200ms for the compressor to release gain reduction. Remember to set the release short enough so that the compressor releases gain reduction before the next transient comes in, otherwise the signal will be in constant compression and thats not good (or it could be - play around with it). It releases
gradually over the release time - this is what makes it different from "hold."
Hold: This is almost the same as release. The difference is that it doesn't release
gradually. Once the signal falls below the threshold, it will "hold" the amount of gain reduction in place for the amount of time you set, and then the compressor will go into the release time. So, if you have a hold time of 50ms and a release time of 100ms: once the signal falls below the threshold, the compressor will hold the gain reduction in place for 50ms, and then release the gain reduction gradually over 100ms. The "hold" parameter isn't as common on compressors as attack and release times. At least if you come across one, you'll know what it does
Makeup Gain: Sometimes referred to as "Output" - This one is simple. Normally, what you're trying to do with a compressor is even out the peaks, but you don't want to make everything quieter. So, you use your makeup gain to turn up the signal after it has been compressed - effectively making the quiet parts louder (pretty much). I always find it's a good idea to try to match the average level of a signal with makeup gain before and after compression, so when you're A/B'ing the effect to see if it sounds better, it'll be just as loud as before (so you can see if it sounds better because it is better, and not just louder).
Sidechain: This one's a little tricky to explain (especially when I don't know what software you're using). Basically, you can set your parameters for compression, and then you can send another signal to the sidechain to trigger the compressor - so the compressor won't do squat until it receives signal from the sidechain. This is commonly done with the kick and bass in dance music. For example: The kick is left untouched through the song, but the bass can get in its way. So, you put a compressor on the bass, and insert the kick into the sidechain. So, when the kick isn't playing the bass is left untouched, but when the kick hits, the compressor will clamp down on the bass and turn it down to let the kick pass through. It can be a little tricky to get right, but when you do it can add a lot of excitement to a song.
Some compressors don't have a threshold or makeup gain setting. Rather, they have an input and output. This was very confusing to me at first but it's rather simple. Basically, the threshold is automatically set within the compressor, and you can't change it. Rather, you can turn up/down the input more/less until the signal hits the threshold where you want it to (you'll see gain reduction on the meter). And the output is just your output level
Now, on to what you originally asked (sorry about all that

)
There are a few different uses for compressors.
Sometimes they're used to shape the "envelope" of a sound - if you're not familiar with envelopes, just ask and I, or another member here will be more than happy to explain. I normally use them on snares for this reason. I'll set a high ratio (about 7:1) and a fairly low threshold until it sounds right. Then, I'll set the attack time to between 30ms-50ms and a quick enough release. That way, when the snare hits, it should be going over my low threshold, and it'll take the compressor a few ms before it kicks in, and it allows the initial strike of the drum to come through loud and clear before it clamps down on it. It's a great way of getting snares to POP!
On the flip side, for an
acoustic guitar (for example), you could set a quick attack time (about 3-5ms) and release time, set a low ratio (about 3:1), and threshold accordingly. If the initial pluck of a string is really loud, and the sustain is much quieter, this should do the job fairly well. It will clamp down on the pluck quickly, and then release to let the sustain of the string pass through nice and loud enough.
You could use a compressor to get a creative sound. One common technique with drums is to put a "room" mic in the room when recording drums, and then squash it with a compressor afterwards. The Urei 1176 is very common for this (I doubt you have one of those though

). Set a low threshold and high ratio (10:1 or above), and play around with the attack and release til it gets really "pumpy", so that nearly everything on the signal gets compressed. Then, you slowly blend it in with the rest of your kit, low enough so that it's not really noticed when it's there, but loud enough so that it's definitley noticed when it's gone. It can add a lot of thickness to the drums. Alternatively, you could compress one or two room mics on the drums, and use them as your main kit sound. I can't think of any examples right now but I'm sure someone else in here will.
You could use a compressor for it's most basic use: Dynamic range control. Let's say you have a vocal that's really dynamic - going from quiet to loud in the same phrase. You don't want to kill the dynamics of the vocal, because that's what gives it it's energy (well, not all the time). But, you might want to control some of that level change. So by compressing the louder parts, you can use makeup gain to "make up" for the reduction in level, and the transition between quiet to loud isn't as big. Just remember, that when using it for this (common) purpose, you normally don't want to "hear" the compression. It should be transparent and smooth, not pumpy, so don't overdo it.
Although, compression isn't always the best thing for that job. I've gotten into a habit of manually gaining up/down individual phrases and words to a relatively similar level before compressing. That way, the compressor has less work to do, and it runs a lot smoother. Then again, after doing that you mightn't even have to apply compression.
Also, just to mention, bass guitar is probably the most commonly compressed instrument in mixing. The bass (along with the drums) usually provides the foundations to a song, and like any building, it's good to have a "steady" foundation. A good solid bassline, consistent in level, keeps the energy throughout a track and provides strength to the sound. Also, I myself find it very hard to compress a bass so much that it sounds bad within a mix, although I'm sure it's possible.
Last but not least: Parallel compression - This is common technique. You double the signal, and compress one and leave the other untouched. Sometimes the compression is heavy (I use heavy parallel compression on my drums sometimes, it's alot like the "room mic" thing I mentioned earlier). Sometimes the compression is light. It can be a great way of leaving the dynamics of a signal untouched, and having it sound more natural, but at the same time, the compressed signal provides a kind-of "backbone" so that if the natural one falls too quiet, the compressed signal is there to back it up and remain heard.
That's all I can think of right now, but just a couple of points:
Always play around with the settings - Play with the attack and release times and listen to what sounds best. Also, sometimes a low threshold and low ratio will work better than a high threshold and high ratio will. Things like that.
Don't hear the compression, unless you're going for a creative effect. There are few things that sound worse on a track than bad compression, or "pumping", unless it's done right and on purpose.
EQ before or after compression? Firstly, listen and decide if your track NEEDS EQ. If it does, then EQ it. Try EQ before compression, try it after, and see what sounds best. I personally like cutting all the crap out with EQ before compression, and then I'll EQ more creatively after compression. This way, by cutting out the crap before compression, the signal isn't being compressed by something that's
not being heard. Then, by EQ'ing after compression, I'm not losing any of my tasteful EQ to compression. Also, when you compress, you can change the tone of a signal. You might want to compensate for that with EQ after compression. Once again, play around, see what works
Does it need compression? - Common mistake by n00bz

Listen to the signal before you touch it. Is it too dynamic? Does it need envelope shaping? Do you want it to have a creative, compressed effect? If it doesn't need compression, leave it alone. Don't compress something just because you think you should.
Only compress it if it needs it.
Don't kill your dynamics - As mentioned earlier, you can suck the life out of a song by over-compressing everything, even if you don't hear pumping. It's not natural at all. How much dynamics are left in your music depends on the song, genre, instrument etc. Listen and decide.
Finally:
Use your ears - This is the best advice for anyone when it comes to audio. "If it sounds good, it is good." Don't judge solely on meters. The quicker you learn to use your ears, the better your mixes will become. Remember, nobody listening to the final product will see your compression meters (or any meter for that matter), so they won't see how good your mix "looked"

It's audio, so trust your ears more than your eyes.
Phew......... I need a cup of tea and a cigarette
Welcome to the board dude