You have credibility when you seem totally trustworthy or believable. You lose it when you start lying, cheating and acting rather shady.
Credibility is a noun that speaks to plausibility or believableness, so the star witness at your trial or the person writing your recommendation letter should certainly have it. Be careful though, because someone with credibility isn't necessarily telling the truth. As any con man or politician can tell you, credibility can easily come from nothing more than a confident smile.