Yes, absolutely.
It's very important to know the mental health history of a person who applies for a gun permit. That is indeed a risk factor. It is thought that in close to 90% of suicides, mental health issues were a factor, ranging from more minor issues such as depression, anxiety, or stress to more serious troubles such as schizophrenia and borderline personality disorder. So this is a major risk factor, though it is important to point out that the fact of having mental health issues does not mean that one will necessarily resort to suicide. In the majority of cases, people will not go as far as suicide, but the fact remains that it is a risk factor.
When an investigation is done to determine whether a person can be given access to firearms, those risks have to be taken into account, and an applicant's mental health history is one element that needs to be considered.