It means to abandon, particularly when plans were already made. I'm pretty sure it originates from how a person can "bail out" of an aircraft when they are in danger. When you bail out there, you suddenly exit to save yourself, leaving the plane and everyone else in there to crash.
When someone bails on you, you are the plane, and they are abandoning you for whatever reason, leaving you on your own.
A lot of times it is used when someone doesn't keep to plans that were already made. "My family and I were going to go shopping together, but my sister bailed on me. My mother also bailed on our plans."