It's used when someone is:
* Lacking focus: They're scattered, disorganized, and not getting things done.
* Making poor choices: Their actions are causing problems for themselves or others.
* Not meeting expectations: They're not performing well in their work, school, or personal life.
Here are some examples:
* "He's been failing all his classes. He needs to get his act together if he wants to graduate."
* "After losing his job, he realized he needed to get his act together and start taking his finances seriously."
* "The team has been losing games lately. They need to get their act together and start playing better."
The expression implies that someone needs to change their behavior and improve their performance. It can be used in a serious or humorous tone, depending on the context.