U.S. elections used to be held over a 34-day window.

As implied by its name, Election Day is, well, a single day. That wasn’t always the case, however: States used to hold elections whenever they wanted within a 34-day period leading up to the first Wednesday in December. This ultimately created some issues, as you might imagine — early voting results ended up holding too much sway over late-deciding voters, for one thing. The current date was implemented by the Presidential Election Day Act of 1845, and federal elections now occur every two years on the first Tuesday after the first Monday in November.
That may sound arbitrary initially, but the date was chosen quite deliberately. American society was rooted even more deeply in agriculture in the mid-19th century than it is today, so November was chosen for its timing after the harvest. Additionally, it took a full day of traveling for many to reach their polling place, which limited options: Church made weekends impractical, and Wednesday was market day for farmers, so Tuesday proved ideal.
The current process isn’t perfect, of course. U.S. elections tend to have lower turnout than those of most other developed nations, and there have been calls for decades to make Election Day a national holiday. A 2018 poll found that 65% of Americans favored the idea, though there’s been little legislative movement on the proposal. Should it ever be put to a vote, you know when it will be held.