This will depend on where you are located. However, regardless of your city, hackathons are typically fewer during summer months, Low season is usually defined as November through March. Shoulder season is April through mid-June and September through October. High season is mid-June through August.
If you are in the US or Europe, September–November and then January–April are the hottest months for conducting successful hackathons. Daywise, Saturday–Sunday are the best combination of days.
If your event will have a lot of workshops and keynotes, you might consider starting on a Friday after lunch.