This one leaves many people uncertain and even provokes debate, as there have come to be competing standards: should it be, for instance, two weeks’ notice or two weeks notice?
There are some people who will insist that the latter is correct and the former not. Such people known not whereof they speak. While one may specify the apostrophe-less version for a house style, the genitive construction – i.e., with the apostrophe – for associating quantified nouns with what they describe is not simply well established in English but is in fact the original way to do it.
The style without an apostrophe is a more recent reconjecture. Its advent no doubt involves a failure to understand the nature of the construction due to the general limiting of our use of the genitive to possession – we tend to believe that X’s Y means that Y is possessed by X. But the genitive in English originally could specify other relations as well, such as simple association, which it does here.
A desire for brevity in newspaper usage may also have something to do with the dropping of the apostrophe, as this seems to be most particularly a newspaper usage: The Oxford Guide to Canadian English Usage mentions that newspaper style books support omitting the apostrophe in cases such as “teachers’ college” as well as in cases such as “five weeks’ work” but that more conservative authorities recommend retaining it.
Some people, in explaining why we use the apostrophe, will say that “two weeks’ notice” is short for “two weeks of notice”. This actually isn’t quite right. Just as “John’s cake” is the cake of John, “two weeks’ notice” could be rephrased as “notice of two weeks” – but, again, the “of” paraphrase is not really appropriate here, as this genitive is not a possessive construction but an associative one. (It just happens that “two weeks of notice” is another way of saying the same thing, but in “two weeks of notice” we are using “weeks” as a container measure like “cups” as in “three cups of flour”; in “two weeks’ notice” the two weeks are an entity associated with the notice.)
Since the apostrophe-less usage is entrenched, it may be used if a publication’s style guide accepts it. But the more pedantic sorts would not be likely to accept it at all; “two weeks notice” is constructed like “four doors sedan” or, for that matter, “a day work” (rather than “a day’s work”) or, thinking of the Beatles, “a hard day night”. If we wanted to make it an attributive noun phrase rather than a modifier in the genitive, it would be better formed as “a two-week notice”.