It essentially means "Good for you!" or "That's great!" It's a way of acknowledging someone's achievement or good fortune.
Origin:
The phrase's origins are uncertain but are likely related to the word "bully" meaning "excellent" or "splendid" which was common in the 19th century.
Examples:
* "You got the promotion? Bully for you!"
* "You finished that marathon? Bully for you!"
* "You're going on a vacation to Hawaii? Bully for you!"
Note: The phrase is generally considered a positive and encouraging expression. It's not intended to be sarcastic or critical.