Before answering this question directly, it is important for you to understand what mental illness is. In psychiatry, mental illness is defined as a condition which causes serious disorder in a person's behaviour,thinking and mood. There are many different categories of mental disorder, and many different facets of human behavior and personality that can become disordered. Mental disorders are classified into ten different categories, of which one is affection of mood.
Now depression is a state where there is sadness of mood or loss of interest and/or pleasure in almost all activities, present throughout the day for a span of not less than two weeks. Since depression is a condition affecting one's mood, it is a mental illness. Under the psychiatric classification of mental illness, depression comes under affective disorders. Affect is a short lived emotional response to an idea or an event whereas mood is a sustained and pervasive emotional response hence to be diagnosed to have depression one must have a sustained mood of sadness or grief for a span of over two weeks.
At this point we have understood and established that depression is a mental illness, but the more important question that could arise is whether it is a disease or not?
A disease is a condition of the living animal or plant body or of one of its parts that impairs normal functioning and is typically manifested by distinguishing signs and symptoms. Diseases are manifestations of a problem with some physical organ or component within the body. And while the brain is also an organ, it is one of the least understood and easily the most complex organ within the body. Researchers and doctors refer to a diseased organ when something is clearly wrong with it (via a CAT scan or X-ray or laboratory test). But with depression, we have no test to say, “Hey, there’s something clearly wrong here!” Hence this often leads to people thinking that depression isn’t a real problem.
But then again, illness does' not simply refer to diseases. We say someone is ill when something is abnormal, either with respect to their health or behaviour. These illnesses where there is no proof as such, but something abnormal are called as disorders. Hence by this we can establish that even though depression isn't really a disease, it is a disorder. A mental disorder.
The question asked by you has a very serious implication in other regards, calling depression a mental illness goes beyond just its understanding. What we call something is important because people tend to put as much effort into changing something as they’re told it needs. If a person is told that it’s a brain chemical problem, they’ll more easily and readily believe it when the physician says, “Here, take this pill and that should make things better.” But as established above, depression is not just a disease, it is a disorder, this means that it can not be simply treated with medication and a combined approach is needed.
To answer such a question, even a thousand words would not be enough and i hope with the above your question has been satisfactorily answered.