For all primaries and caucuses there are deadlines for registration just like the General Elections. You will need to check your state's deadlines. In some states, you must indicate a party affiliation when you register to vote in order to vote in that party's primary election.
For more information on your state's voting system and the important deadlines go to the State Voting Requirements and select your state. Click on Upcoming State Election Dates and Deadlines, for a drop-down menu of important local election dates and deadlines.