The phrase “hit the sack” and the phrase “hit the hay” are actually variations on the same theme with both of them being American colloquialisms. The expression referring to hay is from the early 1900s and the variant referring to a sack is from the 1940s.
It all started with Olympic heavyweight, Sam Berger who announced to reporters of the The Oakland Tribune in July 1903 that he was sleepy and, what’s more, “he was going to hit the hay.”
At the time, it was common for mattresses, or sacks, to be stuffed with either hay or straw, therefore “hitting the hay” was a literal thing.
The phrase “hit the sack” was in vogue during WWII. In fact, the Philadelphia Inquirer wrote on Saturday, December 6, 1941 that it was payday for the enlisted men. According to the Philadelphia Inquirer, this is how payday went for those enlisted men:
By the time various deductions were made, John Joniec and his Army buddies in Schofield Barracks had little mad money left. So they spent the day hanging out, shooting the breeze. About 11 p.m., they hit the sack.