From English movies, I have got an impression to signify that a person is mentally ill, it is said "He is crazy" and that a person is angry upon somebody is signified by "He is mad on her". Although mad and crazy are synonymous, they are almost used the same way I have mentioned. Is it true? If it is, how far?
"Mad" vs "crazy" brings in one of those numerous differences between U.S./American English and British English. Your meaning will be understood, but native speakers of different backgrounds may take a moment to process which word you use.
"Mad", in British English, usually means "mentally ill". The phrase "he is quite mad" indicates a state of complete mental instability. (The phrase "mad hatter" comes from the fact that mercury was once used in making felt, meaning that hatmakers who worked with felt would gradually experience mercury poisoning.)
However, an answer at English Language/Usage indicates that the use of "mad" in the sense of "intensely angry" actually dates back as far as the 14th century. This would seem to indicate that it is not specifically an American usage, though it is generally thought of this way now.
"Crazy" is not a clinical term, but it can be used to describe mental illness. More often in today's English it describes foolishness, as in "you must be crazy to try such a thing!" The speaker in this case does not actually think her listener is actually mentally disturbed.
TL;DR: Neither term would be used by professionals to describe mental illness in modern contexts. Both are acceptable in colloquial use.
In US usage, mad is colloquially used for 'insane' mostly in established compounds like madhouse and madman, and in proverbial phrases like mad as a hatter and mad as a March hare. Its primary sense is 'angry', as in your example (which, however, should be mad at her). It is not so strong as angry: it's usually used to express milder or temporary 'annoyance'.
Mad is synonymous with 'insane' only in fairly formal or literary contexts.
Crazy is the ordinary colloquial term for 'insane', and has its own fixed phrases: crazy as a loon, crazy up the yin-yang, crazy jealous.
Both are also used colloquially as approbatives or approbative intensifiers, as is indicated in the link provided by EnglishLearner.
In American English, mad and crazy can both be used to describe mental illness by exclaiming Are you mad?! (it is usually asked after some strange or blatently stupid act).
When the phrase Are you mad? is used inquisitively, it means the asker wants to know if the person is upset. You could say He is mad at her. or I am mad at the world.
Conversely, saying I am mad about you. or I am crazy about you. signifies a strong attraction towards the person.
Crazy can have many meanings:
- Mentally ill, as you pointed out. John thinks the sky is green. He is definitely crazy.
- Parties, spontaneous fun, daring behavior. John is crazy. He parties all the time.
- Using it to describe the opposite sex, with the connotation that they are clingy, possessive, or overly authoritative. Meme example
- Used to express disbelief or awe. That was crazy! That guy just drove through a red light!
The other answers also have good alternative meanings for crazy.
Both mad and crazy are used in the US and the UK, but Americans are more likely to say crazy, whereas Brits mad (or mental).
So, a US person is likely to say; "He's crazy", "He's gone crazy", "They went absolutely crazy" and "I'm crazy in love".
And Brits; "He's mad", "He's gone mad", "I'm madly in love", "They went absolutely mad" or "They went absolutely mental".