Should I tell a girlfriend about a previous addiction to sexual impurity? If so, when?
If you have entirely conquered the addiction, you might confine yourself to saying that you have struggled with unchastity in the past but have now overcome it. (If you wish, you can also refer to the particular sin by its common euphemism of “impurity.”) If this is still a problem with which you are struggling, yes, you probably should talk with her about it and be frank about your struggle because it will affect your married life. (Graphic details are unnecessary and imprudent; it is enough to state the sin in question and admit that it is one with which you struggle.) As for when, I recommend when the two of you start to seriously discuss marriage.
Christian Courtship in an Over-Sexed World** by Fr. T. G. Morrow