A lot of it depends on 1) the type / brand of compressor you are using, and 2) the style of bass being played.
For the most part, I have found that I need to use a pretty fast attack. Reason is because I often transition from a smooth, mellow style to a funky slap style, often within the same song. If you're slapping, or if you have a tendency to hit your strings hard, then you'll need a fast attack or you'll get a lot of errant peaks, and if you're recording digital, this can mean a lot of clipping.
If the particular music piece calls for long, sustained notes, then you should set your release time much longer than usual in order to give your notes added sustain (so they don't die out on you prematurely, making the mix sound thin in the bass dept.). So on a slower song with sustained notes, the rule is FAST ATTACK, SLOW RELEASE.
If the piece you are playing is faster, with lots of picking involved, then you will need to use a very fast release time. So faster songs = MEDIUM ATTACK, FAST RELEASE.
For "PUNCHY" sound you will want to use SLOW ATTACK, FAST RELEASE. If you want EXTRA PUNCHY, slap/funk, then you will probably want to use a limiter, as well. Set the compressor to medium attack, fast release, and set the limiter to grab a hold of any of the errant "twanks" and "thumps" that may otherwise distort or clip your recording medium.