A compressor used this way is usually part of your mastering chain. You use it to change the general dynamic of your whole track (to reduce the difference between the loudest and quietest parts). It can affect the perceived loudness of your track, but you shouldn't worry about loudness yet. That's the job of a limiter, which you can emulate with Gravity. In general, you don't always need compression. And if you use it, it should be subtle and musical (attack and release times work well with the tempo and rhythm of your track). Here's a good article about it: (link is only visible to registered users)
In my experience, that depends. Compression applied to the whole track during mastering always tries to be as transparent as possible. But side-chain compression, especially in dance/EDM genres, can be much more obvious, like an effect in itself. For example ducking the whole track when the kick drum hits. In that case, you could apply a higher compression ratio. It really depends on what works for your particular track. But in any case, attack and release times are still crucial for the effect to sit well with your rhythm and you should take into account your tempo and beat duration to set them correctly.
Sometimes people try to make a track sound loud as soon as possible, in the compressing stage, by using high ratios and low thresholds, or even in the mixing stage, by pushing the mix bus as loud as it can go. Achieving loudness is usually done at the very last step, with a limiter. Pre-limiter compression is better used to control the dynamics of the track only.
Related to mastering.