It mostly depends on storage. If film is frozen, it lasts at least 12 years past expiration IME. And it is usable with some color correction past that. (I've used frozen color neg film nearly 18 years past date and got correctable color, because it was well stored by the commercial photographer who gave it to me.) Faster films fog more quickly, though. If not frozen, they go off in a year or two (though usually still usable for a few more years). This is not scientific analysis, just based on my own experience with shooting lots of expired color film. (I usually don't bother shooting expired B/W film.)
Aside from storage, the other important thing is buying it in emulsion-matching batches. That way even though imperfect, it at least all acts the same. A few loose rolls of expired film are not of much use to me in a "real" camera. But they are good for toy cameras and such.