Before I answer your question, I think it will be helpful to explain "harmony". The melody of the song is conveyed via single notes. We often refer to chords that are played with the melody notes as the "harmony" part of the song.
Dictionary.com has the following for the definition of "harmony":
the simultaneous combination of tones, especially when blended into chords pleasing to the ear; chordal structure, as distinguished from melody and rhythm.
When we say "this note will 'harmonize'well with that note" - we mean they will blend together in a harmonious manner which will sound pleasing to the ear.
So the harmony part of a musical composition (often meaning the chords) should blend with the melody - in a harmonious manner that is pleasing to the ear - the same way the 3 or 4 notes comprising a chord blend well together in a harmonious, pleasing manner.
While melody notes often change with every beat (or sometimes even more often) chords tend to change much less frequently. Usually a chord will harmonize with several melody notes in a row (perhaps a full measure or bar or even several bars) before the melody strays far enough to favor a new chord. Then the new chord may harmonize with the next series of melody notes before another change is warranted or needed.
Exactly when a chord change is desireable will vary depending on what is happening with the melody. But once the melody notes change enough to where they no longer harmonize with the overlying chord, a new chord is indicated. Sometimes there are other reasons to change chords for various effects - but let's don't complicate things for now.
For a more in depth discussion of how melody notes harmonize with chords - check this out on Stack Exchange - What melody notes go with particular chords?
In that link you will find a discussion of chord tones and how they fit together with melody notes and so forth. But often more than one chord could potentially harmonize with a section of the melody. So besides choosing a chord that harmonizes with the notes of the melody, a composer will also look at what he/she is doing with the melody at the time. In other words - if the melody is ascending away from home towards the top of the scale or into a higher octave, the chord progression will want to reflect that musical direction. Alternatively, if the melody voice has peaked and is headed back down the scale towards a resolution, the chord progression should also be moving towards a resolution.
That's probably more chord theory than you need to understand at this point and could be another discussion altogether. But for purposes of answering your question, you just need to begin to understand how a single chord can harmonize with a section of the melody. And that section of melody can be a short section or a long section, depending on where the melody notes go.
Believe it or not there are one chord songs where then entire songs melody will harmonize well with just one chord. Try any major chord and sing the melody (in the corresponding key) for Frère Jacques (Brother John). Many songs only have two chords. And literally millions of songs use only three chords to harmonize the entire melody.
I hope this will help you understand the concept of harmony as it relates to chords. Have fun with your music.