You say it when something is so obvious or when you're being dumb. It's kind of like saying duh.
A girl with red hair walks into a room: Boy: OMG! she has red hair!!!! Girl: AH DOI