When you buy your cement at the home center you'll notice the bag is lined with a plastic sheet. This is to keep the moisture out. For those who are new to cement, moisture is cement's worst enemy. Yes, you need to mix water into cement prior to using it, but what happens when you accidentally splash water into a half used cement bag while it's sitting on your garage floor? The chemical reaction begins and the cement starts to "cure". Curing is the process where the cement begins drying or hardening – aka turning into the hard gray stuff we all see under our homes etc. Any amount of water or even moisture will do this – the degree varies with the amount of water added.
This is why you sometimes see little, hardened, pebble-like cement balls in your cement bag. You'll see more of them as time passes and your bag of cement is allowed to sit there and absorb moisture. This is why ideally, you will try to use your cement as soon as possible after buying it. It would generally be a good idea to only buy what you think you'll need for a particular project and no more. Buying in "bulk" in this case would NOT be a good idea. Having said that however, I have had cement sit in my garage for a good part of a year and still perform its duties when I rolled it out.
Of course, even though I could not see any visible difference in the way the cement turned out, I know due to science and the word of professionals, that given regular circumstances, old cement will never cure as strong as new cement. This is why older cement is acceptable for projects that do not require immaculate results such as a mortar bed or concrete stumps that will not be subject to any – or very little – lateral or shear forces. This does NOT mean that you can use cement no matter HOW old it is! There is such thing as going past the point of no return with cement, and if this happens, I would not recommend using it for anything – besides maybe a filler.
But I have had success with using moderately old cement for projects like mortar beds without any problem at all. I've also had total failure using cement that HAD "gone past the point of no return" where even after leaving it for a week, it would crumble out like a termite-eaten piece of wood when I would probe at it with something hard . This is what happens when you push the envelope with BAD cement! If after 48 hours your cement still feels even slightly soft when pressing firmly down on it with your thumb, this is a sign that your cement is … well, bad (for lack of a better word). There is no exact lifespan or "shelf-life" of raw cement but I would recommend using it within 6 months of purchase if you DO NOT require maximum strength, and 1 or 2 months if you do.