In general, a mentally ill or incompetent person cannot legally sign a binding document. However, the presumption is that a person of majority age is competent, unless an action has been instigated to declare someone incompetent. Presumptions can sometimes be overcome. You should consult an attorney in your jurisdiction.
(This is intended as general information only and not intended to be legal advice. This attorney is not licensed to practice outside of North Carolina. Your specific situation may be different).