That's why CDC recommendations specify that every adult should accumulate [emphasis added] 30 minutes or more of moderate-intensity physical activity on most preferably all days of the week. (Though that prescription has risen to 60 minutes in some quarters.) But to help your heart get its best possible workout, there is something to be said for getting at least 20 minutes in one haul. It can take your heart rate several minutes to stabilize at an elevated workout pace.
Moreover, if you are trying to develop the metabolic infrastructure of endurance, your body needs to go for a long time in order to learn how to go for a long time, so a few short bouts of exercise won't cut the mustard.