Prejudice is a preconceived opinion or attitude, not based on reason or experience. It’s mostly used in a negative sense; “Joe is prejudiced against women”. But it can be used positively.
Stigma (“stain”) is a (usually figurative) mark of infamy or disgrace; “he bears the stigma of having openly supported Donal Trump”.
Note that prejudice is something the observer/commentator/actor has, whereas stigma is a charactertistic of those observed/commented upon/acted upon.
The two can overlap where a particular characteristic is only considered disgraceful because of other people’s prejudice; the “stigma of illegitimacy” is only a stigma if people are prejudiced against those born out of wedlock.
A stigma can certainly lead to prejudice. For example, there is generally a stigma against convicted felons. If you are trying to hire for a position in your company you may be prejudiced against a candidate who is a felon because of that stigma, despite otherwise being the most qualified candidate to apply for that position.
IMO the stigma is attached to the person with the disfavored status, and the prejudice is attached to the person with the favored status.
‘There is prejudice against persons with mental illness.’
‘There is a stigma associated with being diagnosed with mental illness.’
The prejudiced man can’t look past the other man’s stigma (mark of disgrace). That which is stigmatized changes over time, of course: being born out of wedlock, living together ‘in sin’, being the wrong race or religion, etc. I suppose a cynic would say that when only a minority still see the stigma, that minority becomes prejudiced, when before they were just being prudent or God-fearing or showing common sense or whatever the zeitgeist was.
As to Atamasama’s example, I would say that there is a stigma to being a convicted felon