It’s called an arpeggio what you describe.
It is also sometimes referred to as a “broken chord” which makes some sense—if there are two or more notes played simultaneously with a “normal” chord, then an arpeggio would basically take the “fragments” of that chord (the individual notes) and play them one by one.
For a number of reasons, musicians use arpeggiation. First, it can be more interesting for chord progressions. Playing chords in blocks (when all notes are played at once) can be fun, but it is almost like moving down a river, evoking a sense of permanent motion from one chord to another.