It means to go to bed or to sleep.
Here are some examples:
* "I'm tired, I think I'm going to hit the sack."
* "I'm hitting the sack early tonight, I have to be up early tomorrow."
The idiom is thought to have originated from the use of sacks as bedding in the past.