If the music has a time signature (and the majority of western music that is performed today does have one) then the "number of notes" in each bar should match the time signature, as in Simon B's example.
There are a small number of exceptions to that "rule" - for example, a piece of music can start "in the middle of a bar", and the first bar of the score (often called a "pickup bar") will have fewer notes than the time signature indicates, because the rests and the start of the bar are not written. The same can apply to the last bar of the score, and repeated sections (shown by signs which look similar to bar lines) can also start and end in the middle of bars.
Before about 1700, a lot of music (except for dance music, which by its nature usually has a regular rhythm) did not have a time signature, and the bar lines were mainly to indicate the start of the musical phrases, and provide a reference points if the piece was for several performers.
Some contemporary music also does not use time signatures, but if you are just beginning to study music with an teacher, most likely all the music that you study in the first stages of the course will have time signatures.