Very often we find rhythm patterns in the music we hear. We are generally able to group the rhythm in beats of 2, 3 or 4.
For instance, when we listen to a waltz, we feel the beat pattern as 1, 2, 3.
There are measures of 2, 3 and 4 beats. Although less common, we occasionally find measures of five or seven beats. To indicate the measure we use two things: the time signature of the measure and the bar lines.