Typically when we hear that a state is “won,” we are hearing a news desk’s projection that a candidate has won. This is not an official announcement; rather, it is a decision by a particular news organization that they are certain that when all the votes are counted, the projected candidate will win that state. The official results of each state may not be officially certified until weeks after the election. While some states require that the votes be certified within one week of the election (such as Oklahoma and Vermont), other states may take much longer to certify their votes (California, for example, sets their vote certification deadline at 32 days following the election).
After states announce who won, they must file a certificate of ascertainment, which lists how many votes were received for each state of presidential electors. Each state is required to have their governor (or Mayor, in the case of the District of Columbia) sign a certificate that states the vote total for their state. This document is also often signed by the state’s Secretary of State, and is sometimes signed by the Lieutenant Governor. Each state signs their certificate of ascertainment at different times (the earliest state to sign its certificate of ascertainment in 2016 was Hawaii, who filed their certificate 9 days after the election; Montana, by contrast, signed their certificate of ascertainment 42 days after the election).
Each state must also submit a certificate of vote, in which each member of the state’s electoral college signs and declares their vote for their candidate. Every state must submit their certificate of ascertainment on the first Monday after the second Wednesday in December following the presidential election.
All full accounting of each state’s deadlines for vote certification, and list of the dates when each state’s certificates of vote and ascertainment were signed in 2016, can be found here.