Compound Numbers that are below one hundred and made up of two words require hyphenation.
Compound adjectives used before a noun are hyphenated as well, requiring "24" and "hour" to be hyphenated in "24-hour shift".
So only example 3, "I am doing a twenty-four-hour shift tonight" is correctly hyphenated. When read aloud, of course, all three orthographies sound the same.
Note that the first example appears to be badly hyphenated rather than referring to twenty shifts of four hours each. Presence of the indefinite article "a" and use of "shift" in the singular indicate only one shift is being talked about.