In the beginning we will use rest intervals between swim portions to break up the distance. Rest is there to give not only your body a moment to restore some energy, but for your mind to restore higher attention.
Rest may be passive (like waiting quietly at the wall), or active (like doing a drill or exercise that is different and lighter than the main action).
You can read more about types of rest:
In general, I recommend that you use 5 to 15 seconds passive rest between repeats (breaks between those smallest swim pieces in each set), and 15-30 seconds active rest between rounds (those breaks between a set of swim pieces).
Of course, the goal is to eventually remove rest until you can swim the entire distance continuously. So, keep in mind that gradually reducing rest intervals (by swimming longer repeats, or by taking less seconds for rest between repeats) is an sign of increasing fitness, in body and mind.