Originally everything was back-timed so that the voting would be completed by the time the Electoral College was to meet on the first Wednesday in December; in 1792 it was specified that the election for presidential electors needed to be held “within 34 days preceding the first Wednesday in December, every fourth year.”
In 1844 a bill was introduced (passed it in 1845) specifying a uniform election day for all states. The original bill stated “the first Tuesday of November,” but it was amended to note the “first Tuesday after the first Monday…” Without that alteration, the first Tuesday did not always fall within 34 days preceding the meeting of the Electoral College. (The first election where this new schedule was applied was 1848.)
In 1887 the date of the Electoral College meeting was moved to the second Monday in January, in years following a presidential election; this wiped out the “within 34-days” issue. In 1936 another date change for the Electoral College occurred, and it’s the one we now abide by: The Electors now meet in their respective states to cast their votes on the first Monday after the second Wednesday in December.
The country has maintained the earlier tradition of the “Tuesday after the first Monday in November.”
A Tuesday was selected because voters often had to travel to come in to town in order to vote. The government did not want people to have to travel on the sabbath (Sunday for most Americans), so a Tuesday was selected as being a preferred day of the week for voting.