My feelings is that we let the Doctors and the courts decide. Forbidding someone from owning a gun because of mental illness would take a court order or conviction in a court of law that the person is a threat to society if they owned a gun due to their mental illness.

It's the bar we set for many other things in our society. Seems reasonable to me.