What mental health standards must a candidate meet in order to qualify for a pilot's medical certificates?
Canada:


  1.3 The applicant shall have no established medical history or clinical diagnosis which, according to accredited medical conclusion,
  would render the applicant unable to exercise safely the privileges of
  the permit, licence or rating applied for or held, as follows: (a)
  psychosis or established neurosis; (b) alcohol or chemical dependence
  or abuse; (c) a personality or behaviour disorder that has resulted in
  the commission of an overt act; (d) other significant mental
  abnormality


US:


  Unless otherwise directed by the FAA, the Examiner must deny or defer
  if the applicant has a history of: [...] (8) Psychosis; (9) Bipolar
  disorder; (10) Personality disorder that is severe enough to have
  repeatedly manifested itself by overt acts; (11) Substance dependence;
  (12) Substance abuse; [...]


EASA (Europe) (abbreviated):


  AMC1 MED.B.055 Psychiatry   (a) Psychotic disorder   (b) Organic
  mental disorder   (c) Psychotropic substances   (d) Schizophrenia,
  schizotypal or delusional disorder   (e) Mood disorder   (f) Neurotic,
  stress-related or somatoform disorder   (g) Personality or behavioural
  disorder   (h) Disorders due to alcohol or other substance use   (i)
  Deliberate self-harm   
  
  AMC1 MED.B.060 Psychology   (a) Where there is
  suspicion or established evidence that an applicant has a
  psychological disorder, the applicant should be referred for
  psychological opinion and advice.   (b) Established evidence should be
  verifiable information from an identifiable source which evokes doubts
  concerning the mental fitness or personality of a particular
  individual. Sources for this information can be accidents or
  incidents, problems in training or   (c) The psychological evaluation
  may include a collection of biographical data, the administration of
  aptitude as well as personality tests and psychological interview.
  (d) The psychologist should submit a written report to the AME, AeMC
  or licensing authority as appropriate, detailing his/her opinion and
  recommendation.