The degree of mental illness matters. If the mental illness is as defined under Section 5(ii):
5 Conditions for a Hindu marriage. A marriage may be solemnized between any two Hindus, if the following conditions are fulfilled, namely:
2
[(ii) at the time of the marriage, neither party
(a) is incapable of giving a valid consent to it in consequence of unsoundness of mind; or
(b) though capable of giving a valid consent, has been suffering from mental disorder of such a kind or to such an extent as to be unfit for marriage and the procreation of children; or
(c) has been subject to recurrent attacks of insanity
then the marriage is a voidable marriage and the same could be nullified by a petition under section 12 Hindu Marriage Act subject to not condoning the same after knowing that.
Consult a lawyer for appropriate advice with full case history.
Original Answer: Here