Improvising within a song involves special considerations which are not necessary when just "jamming" with a chord progression. These considerations are most important when you reach the stage of forming a repertoire for group performance.
In a song, the lead guitarist does not usually play at the same time as the singer is singing. (When a lead guitarist is not playing lead, they generally play rhythm). Instead he or she may play "fill-ins" in between the singers lines, or play a lead solo during a vocal break. Another common role for the lead guitarist is to play a brief introduction or ending to the song.