How can a psychiatrist tell the difference between withdrawal and relapse, when coming off medication?

Depends. Depends on the medication type and the disorder being treated. Discontinuation symptoms asssoc w/ serotonergic meds can overlap with some anxiety and depression symptoms, making this a valid question. Slow taper off meds, in my experience, minimizes or can entirely eliminate any discontinuation symptoms (which have been rare in my practice, perhaps because I do taper slowly and carefully).