Some people are "deeper thinkers" than others, but I don't think it's about how "deeply" someone thinks, or how often he does. I think it more has to do with whether or he has a generally healthy mind.
I think a symptom (not cause) of mental illness is often that people start pulling inward and way from other people. I don't have the expertise to say that deep thinking and lots of it doesn't EVER cause mental illness, but I generally think that the behavior I described above can SOMETIMES be a sign that a person is struggling with mental-health issues (and certainly not always "madness"). If by "madness" you mean Schizophrenia (which is usually what people mean when they say "madness"), something that has been associated with that particular mental illness has been heredity and stress.
Having said that, though, it's really common for people (especially people who are young and trying to figure out their purpose and place in the universe; as well as having time on their hands to "ponder" "deep things" ) to spend quite a bit of time thinking. When my two girlfriends and I were late teens, two of us enjoyed pondering the meaning of life, the universe, philosophy, etc. The third wasn't someone who liked doing a lot of thinking/discussing. She'd put up with our hours-long philosophy and "all of life" discussions for awhile. Then she'd say, "I'm leaving. You guys are too deep!" LOL It was a joke between the three of us because two of us knew how prone to "deep pondering" we were - alone and together. :) Eventually, settled into my own version of all those issues, had my family, and moved onto different kinds of thinking. I think most young (and maybe not always so young) people have to work out all the deeper issues of life before feeling they've reached some "resolution" to some extent - and then they go on, keep thinking, but base future thinking on what they've already "established" about life.
Anyone who is concerned about his own mental health should talk to a professional about it, but I don't think (no, I know) that, by themselves, deep thinking or long stretches of thinking are signs of or causes of mental illness.
Aiming for good balance of activities/socializing in life is always a healthy thing, though. Sometimes people who don't have a lot of other activities (even if only for a short period of time) think "for fun" (because it can be interesting). :)
Keep in mind that I'm not a professional and that this is only a personal opinion.