In 1845, the United States Congress voted to set a uniform date for general elections.
During this time period, the United States was largely an agrarian society and farmers needed a full day to travel by horse-drawn vehicles. Congress didn’t want voting to interfere with the Biblical Sabbath (Sunday) or with market day, which was typically held on Wednesdays. Therefore, Tuesday was the best choice. Also, November was chosen because it was after the harvest and before the winter storms.
Before 1845, there was a law permitting each state to conduct their presidential election anytime during the 34 days before the first Wednesday of December.