An exclamation mark is used after interjections or commands. (An interjection is a word or phrase used to express a strong feeling.) It expresses an emotion such as surprise, anger, fear, pain or pleasure.
EXAMPLE: What a complete waste of my time! / Sit over there and be quiet for an hour!
EXAMPLE: He's here! He's here! / We won! We won! / Quiet!