By federal law since 1792, the U.S. Congress permitted the states to conduct their presidential elections (or otherwise to choose their electors) any time in a 34-day period before the first Wednesday of December, which was the day set for the meeting of the electors of the U.S. president and vice-president (the Electoral College), in their respective states. An election date in November was seen as useful because the harvest would have been completed (important in an agrarian society) and the winter-like storms would not yet have begun in earnest (a plus in the days before paved roads and snowplows).
National elections take place every even-numbered year. Every four years the president, vice president, one third of the Senate, and the entire House are up for election (on-year elections). On even-numbered years when there isn’t a presidential election, one third of the Senate and the whole House are included in the election (off-year elections).