Young people say this often when they messed up something, such as an exam. They also say this when they feel like they are in a troubling situation, such as failing an exam. It can be used for various situations. For example: I think our first date didn't go well... 망했다.
Oh, and just to clarify. Most of the things I post are in 반말 (ban-mal is informal speech). It's mostly used to communicate with your friends and to the people you know well.