To hit the hay means to go to sleep or to go to bed. It refers to the fact that animals doze off on piles of hay as it makes them comfortable.
A similar idiom is to hit the sack.
1. After a long day's work Subhadra was eager to hit the hay on reaching home.
2. Jagdish decided to hit the hay and not stay up late as he was feeling bone-tired.
3. The hostel warden told all the students that they must hit the hay before 10p.m. as they had to get up early next morning for the trekking trip.