A primary is when each party decides which candidate they will run ("nominate") in the general election. So for instance for president, the Democrats need to decide, through primary elections, which person will represent the Democratic Party to compete against Donald Trump in the general election on November 6, 2020.
The Republicans also will have primaries, but the president who is incumbent (already elected) is almost always going to be that party's nominee.
As to why we don't all vote in our primaries on the same day, this article from Vox magazine explains the history behind the order in which different states vote (a tradition that is being increasingly challenged).
Although we vote for presidential candidates, the number of votes cast (called the "popular vote") is not what matters most in the end. Instead, each state is allotted a certain number of "electoral votes" according to its population, with "electors" designated by the parties to vote on our behalf. There are 538 electoral votes in the country, so a majority of 270 votes is needed to win.
Note that the number of electors each state gets depends on how many representatives we have in Congress, which depends on how many people live in the state - this is yet another reason why the CENSUS is important! The deadline is soon - September 30 - so if you haven't responded to the census (please note it doesn't matter what anyone's documentation status is), you can do so until then.
This TED video gives an excellent overview of the process and touches on some of the pros and cons in the arguments about our system. It is a few years old now, but still accurate.
This National Archives site also talks about the history and some of the controversies around the electoral college
Hostos Library also has many more resources you can read for free covering the history, criticisms, and defenses of the electoral college system.
A brief overview from the Encyclopedia of American Government and Civics.
Please see the attached ebooks below as well, and \Here is a search on OneSearch to get you started if you'd like to investigate further on your own.