Giving a psychopath or a sociopath a gun is probably a bad idea. Giving somebody with schizophrenia is also probably a bad idea. Depression might be a bad idea. As well as other things.
I wouldn't say lower level mental disorders would be that big of an issue, like Asperger's or something, but yeah there should be background checks and restrictions based on them.