You can assert your Fifth Amendment privilege against self-incrimination when you have reason to believe that your response could:
If the circumstances are appropriate, you can “take the Fifth” at any kind of proceeding, including civil cases and administrative actions (for example, a DMV proceeding to suspend your license after a DUI arrest.) You can also invoke your right to silence when dealing with law enforcement. (See When and How to Invoke Your Right to Silence.)
The question for some witnesses is whether, when called to testify, they can altogether avoid taking the stand on the basis of the privilege against self-incrimination. Criminal defendants have the right not to take the stand—the prosecution can’t call them and put them in the awkward position of invoking self-incrimination in front of the jury. But in general, other people can’t evade an appearance at the stand, even if they will simply take the Fifth once the questions start coming. Those in this position (and, of course, criminal defendants) should seek the advice of an experienced lawyer.