Are mental problems linked to age?

Not directly. Of course, some types of mental problems are increasingly common in older people (e.g., dementia), but it is not the age, per se, that causes it. Instead, some types of brain disease processes can begin to show up as a person ages. These diseases are sometimes manifested as memory or other cognitive problems or difficulties. Other mental disorders also tend to have onsets within specific ages.
Depression, yes. Depression is certainly linked to aging. Beyond the age of 70, there's an increase in the incidence of depression, alcoholism and suicide. People get sick. They're limited physically. They lose loved ones and close friends. Unfortunately, sometimes getting older is not pleasant.