You'll find it easier to answer this question if you refine it more carefully. "Mental illness" is far too broad a category, and the answer will vary by diagnosis. For example, schizophrenia is thought to have a genetic component and generally has onset in late adolescence or early adulthood. Autism is diagnosed early in childhood and not thought to be hereditary. Most research will be focused on the specific disorder. I'll send some articles in additional answers.