It means to be in a difficult situation with no easy solution, where any choice you make will have negative consequences.
Here's how it's used in a sentence:
"I'm stuck between a rock and a hard place. If I take the job, I'll have to move, but if I stay here, I'll never get ahead."