Keeping offer open

I've seen instances where a promise/stipulation to keep an offer/contract open are valid and other instances where it's not honored. I'm confused. Anyone know when an offer must be kept open and when it's okay to end the offer/contract BEFORE the stipulated time period?