To start with we'll take a look at tannins. The compounds that are known in the dental profession to contribute to staining of the exterior surface of the tooth.
Extrinsic stains tend to form in areas of the teeth that are less accessible to tooth brushing and the abrasive action of a toothpaste and is often promoted by smoking, dietary intake of tannin-rich foods (e.g. red wine) and the use of certain cationic agents such as chlorhexidine, or metal salts such as tin and iron. The bleaching of teeth-A review of the literature.pdf
These tannin compounds have been scientifically confirmed in coffee at concentrations of about 1%, however this does not mean it is the ONLY staining component of coffee.
The presence of soluble condensed tannins in Coffea arabica pulp was confirmed at approximately 1% db.
We can also see that the tannin compounds react with the casein in milk by binding to them and tanning (staining) them. The milk taking up the tannin compounds directly reduces the number of free tannin compounds that can react with the enamel and other external surfaces of your teeth.
Just as the protein of untanned hide is combined with tannin to form chemically tough collagen/tannin complexes, so in the teacup, the milk's protein turns into tannin/casein complexes. But there is a difference: in leather every reactive point on the protein molecule is taken up by a tannin molecule, but this need not be so in tea. Dan Lowy in letter to the Guardian Re:tannins in tea