In 1845, Congress designated the first Tuesday following the first Monday in November as Election Day for presidential elections by federal law.
Before Election Day was created by Congress in 1845, individual states held elections within a 34-day period before the first Wednesday in December. Early voting results affected turnout and changed voters’ minds in states that held later elections, leading to those later voters drastically swaying national elections.
Image: Campaign button from Lyndon Johnson's 1964 presidential campaign (Gilder Lehrman Institute, GLC09750)