Having enforceable estate planning documents require that you have the necessary capacity. This is self-evident, since those who lack the mental ability to understand their actions can't coherently express their wishes about how they want their assets distributed. Capacity, however, can be a sliding scale depending on the particular action being completed.
California Law
The California Probate Code is helpful to some degree in understanding the definition of mental competence. For example, in the case of a Will, one can look to Probate Code Section 6100 and 6100.5. Probate Code Section 6100 states the following:
"(a) An individual 18 or more years of age who is of sound mind may make a will.
(b) A conservator may make a will for the conservatee if the conservator has been so authorized by a court order pursuant to Section 2580. Nothing in this section shall impair the right of a conservatee who is mentally competent to make a will from revoking or amending a will made by the conservator or making a new and inconsistent will."
And, Probate Code Section 6100.5 states the following:
"(a) An individual is not mentally competent to make a will if at the time of making the will either of the following is true:
(1) The individual does not have sufficient mental capacity to be able to (A) understand the nature of the testamentary act, (B) understand and recollect the nature and situation of the individual’s property, or (C) remember and understand the individual’s relations to living descendants, spouse, and parents, and those whose interests are affected by the will.
(2) The individual suffers from a mental disorder with symptoms including delusions or hallucinations, which delusions or hallucinations result in the individual’s devising property in a way which, except for the existence of the delusions or hallucinations, the individual would not have done.
(b) Nothing in this section supersedes existing law relating to the admissibility of evidence to prove the existence of mental incompetence or mental disorders.
(c) Notwithstanding subdivision (a), a conservator may make a will on behalf of a conservatee if the conservator has been so authorized by a court order pursuant to Section 2580."
Other Probate Code Sections thare are helpful in understanding mental capacity and its contours are Sections 810-813.
Considerations
It's important to know that many mental impairments do not necessarily rise to the level of legal incapacity. For example, one may suffer from depression or anxiety, and yet may still be able to fully comprehend and understand the decisions they are making in their estate planning documents.
That being said, lack of legal mental capacity can present a substantial stumbling block for families trying to help a loved one complete an estate plan. The best course of action is to begin relatively young, when the mental faculties are still in tact. You never know if a sudden, unexpected accident or illness could lead to a permanent and lasting impairment.