You often hear lead guitar playing at guitar solos, intros and outros, and sometimes as breaks between sections in a song. You can think of lead guitar as replacing the vocalist, for supplying the main melodic material of the song, at that point in time. In most rock, pop and metal music, the main melody of the song is performed by the vocalist.
Lead guitar is when a guitarist plays a melody, usually in a higher pitch range.