What is the difference between a closed primary and an open primary?

In an open primary anyone can vote for any candidate in either party regardless of whether they are registered democrat or republican. In a closed primary you can only vote for someone in your registered party.