Hmm.
apart from the obvious attributes of compression making notes played at lower volumes louder and evening out louder peaks in a signal... do be aware that compression also increases the noise in your signal chain because not only does it amplify your guitar's signal, it would amplify the signal's noise as well.
Don't be fooled by the notion that compression adds sustain. If you guitar has little or no inherent sustain, a crazy amount of compression would not improve the sustain without adding discernable amounts of noise.
That said, you can always overcome this by implementing the compressor after a noise gate. This applies for both bass and guitar applications. I personally avoid compression because when I kick in my overdrive pedal (esp those Marshall or DS-1 type drives) the drive signal would already be compressed.
Plus, I must say that my style of music is very old-school. If you're after good sustain in terms of clean sound, I would suggest you invest in better hardware (bridge, machine heads etc).
Lastly, only use compression if you feel it improves your sound, rather than just adding it for the sake of adding compression. Be aware that too much compression makes your instrument sound 'squashed', and it may actually hamper your instrument from cutting through the mix in a band situation.