The law determines when an election is over—not the media. Yet reporters often predict who is going to win, sometimes even before votes are counted based on lopsided polling. Other times they predict a winner based on most of the votes being counted, or even once all the votes are counted. Such claims are usually correct (but not always—just ask “President Dewey”) and are protected by the First Amendment, but none have any legal meaning.
So when does the presidential election really end? The National Archives and Records Administration provides a helpful timeline (federal law directs the NARA to collect and maintain Electoral College records). On Election Day, each state held an election to choose its presidential electors. Those elections are conducted according to state laws and must also follow certain federal laws and constitutional provisions. The actual votes for president and vice president will be cast by presidential electors in each state on December 14. Those votes will be counted by Congress on January 6, 2021. The election result becomes official once Congress counts the votes and approves the result—at that point, legally, there is a president-elect.
Of course, with Inauguration Day on January 20 and a vast federal bureaucracy, it is important for a new president to begin planning to take office before the inauguration. In fact, long before Election Day a non-incumbent, major-party candidate will have a few people begin planning for a possible transition. This is not presumptuous, it is simply practical. And in an election won by a large margin or where there are no questions about the results, the outcome may be clear as early as election night. On the other hand, plenty of elections have been close enough that the result took days or even weeks to figure out for certain. And, again, legally it is only over once Congress certifies a winner in early January.