In theory, a year or so... in practice, usually less, mostly due to handling. I think if properly prepared and dried, and then sealed in modern containers, quite a bit more. It's going to taste like a brick, and its best use is in addition to a soup, but if you're preparing for an extended time without the means to procure flour or grind your own grain (modern wheat packed in #10 cans often lasts over 30 years), it'll do, and it's relatively cheap, I suppose.
I think the real utility of it is as a portable lightweight food item. If you're going to be in the woods for weeks, it's one way of carrying your bread. If you're on ship and space is tight, or you're in a situation where mobility trumps longevity, then hardtack seems an appropriate answer. I wouldn't store it in any great quantity in a long term food storage plan, though. Make a decent sized batch once a year, and rotate it out every other year... if ya gotta bug out, grab a few pounds of it and some instant soup mixes, and get on your way. Don't try to live on it for months, though.