No matter how you look at it, an anime is a cartoon. The main difference is that an anime is considered a Japanese style of cartoons in the West.
Many English-language dictionaries define anime as "a Japanese style of motion-picture animation" or as "a style of animation developed in Japan."
However, in Japan, the term "anime" does not specify an animation's nation of origin or style. Instead, it serves as a blanket term to refer to all forms of animation from around the world (both foreign and domestic). The word "anime" is loan word referring to "animation" or "cartoons," adapted from the English word "animation."
Taking this from another perspective, in Japan, Disney movies are referred to as "Disney Anime", This refers to a certain style, not the genre as a whole.
The Japanese Wikipedia on "anime" specifically notes that:
アニメーションをアニメと略せる言語は日本語に限られるため、日本国外で「anime」という場合は日本製の表現様式のアニメに対して用いられる。日本国内では、製作国や作風に関わりなくアニメが使用される。
While in Japanese, "animation" was abbreviated to "anime," Outside of Japan, the word has been used only to refer to media considered "Japanese animation." However in Japan, the country of origin and literary style (of the media) are not taken into account when applying "anime" to it.
Western cartoons and anime can both vary in drawing styles, based on the staff, budget, and character/set designs. Anime series are typically more detailed than your average western show as there is more of an abundance of technically skilled artists overseas than there are available in the West.
Both can reach different age regardless of their initial target audience (Avatar: The Last Airbender, My Little Pony, and Adventure Time are notable examples).
Typically western cartoons are more lighthearted when compared to Japanese anime. However, both can deal with more mature themes, in both a serious (like Cyber 6, Mighty Max, and Dungeons and Dragons) and humorous light (like Futurama, South Park, The Simpsons, and Family Guy). There are western cartoons for mature adults just like there are 18+ anime in Japan.
If you ask the average person in your country and one in Japan, both will consider them to be childish. The difference between anime and cartoons is very subjective. It typically comes down to what you like and how you like it.