Depends on your jurisdiction. Generally, the ring is a conditional gift, and until the condition is fulfilled, it can be revoked. Whoever broke off the engagement is responsible for the condition not being fulfilled, and loses their claim to the ring. So if the groom-to-be broke off the engagement, he prevented the marriage from occurring, and the bride-to-be keeps the ring.
Several states have modified this rule. If you're in Connecticut, Iowa, Kansas, Michigan, New Jersey, New Mexico, New York, Pennsylvania, or Wisconsin, it doesn't matter who broke off the engagement. If it's off, the groom gets the ring back.