We will be taking the train from Hamburg, Germany to Delft. We may make quick stops in Haarlem and/or Leiden. Can we just buy tickets from Hamburg to Delft and get out at a stop and then get back on later, or do we need to buy tickets for each specific portion of the route?
You don’t need train tickets once you are in the Netherlands. You can just tap in and out with your credit card at each station.
You might find my trip report from last year helpful. Scroll down to public transportation.
The tap on/off in the Netherlands is awesome. So is Haarlem. It's a quick walk to the center of town from the train station which is in the start of the town itself. I've never been to Leiden so can't compare.
Within the Netherlands, "If you have a mobile or e-ticket (one-way or day return) then you are allowed to make unlimited stopovers at any stations along your specified route." So if Delft is your final destination, you could make stops and Haarlen and/or Leiden without paying extra or getting additional tickets as long as you don't backtrack and it is during the same day. You might need to check further how that works if you are starting in Hamburg.
You are only allowed to do stop overs if you stay on the normal route. You can take a longer route if it has less transfers. But then you can no longer break your journey.
The shortest route does not pass via Haarlem or Leiden. It goes (once in the Netherlands) via Utrecht and Den Haag. So with a normal ticket you cannot break your journey in Haarlem and Leiden. I would suggest that in your case just book till Amsterdam, and then just tap in/out with your CC for the rest of the trip.
Thank you, WengenK, for clarifying and correcting my post.