Hammering-on, as opposed to plucking each individual note while playing a guitar solo, is an important technique to understand if your progressions are to flow smoothly. Think of it as the difference between floating on top of the water on a day when the seas are rough versus a day when they are calm. You would much rather float on the water when the seas are calm lest the choppiness of the waves muddy up your experience. Hammering on, likewise, prevents choppiness in your sound. The best part is that learning how to do it effectively is not so difficult.
You should begin hammering on by playing a scale – say, the pentatonic scale in the first position, key of "G." If you're accustomed to plucking each individual note up and down the fingerboard, instead pluck the first note in the scale and place your finger in the position of the next note in the scale (this should be on the same string) without actually plucking the second note. So, you have played each of the two notes only having actually plucked the string one time. This is called hammering-on because your finger comes down hard like a hammer and presses down enough for the note to be heard without actually plucking it. To practice, try doing this with every other note in your pentatonic scale. On each string, you should pluck the first note and follow it up by hammering-on the second note as opposed to plucking the string again.
Hammering-on is beneficial to your playing because it eliminates the choppy sound of continuously-plucked notes, providing greater fluidity to the sound of any progression. Furthermore, it allows you to play faster than before since you're not having to move your picking-hand into position so often. Hammering-on is how some of the world's greatest guitar players are able to achieve the quickness they demonstrate each time they play a solo.
As for using using hammer-ons within your own progressions, wait until you're comfortable using the technique in scales. Thankfully, this is one of the least difficult skills to master, and after an adequate number of hours spent practicing it, you should be hammering-on like a pro. In your original songs and melodies, you will quickly notice how much smoother your solos are sounding and how much more quickly you're able to play them.
It's also worth noting that the hammer-on technique is often learned in tandem with the pull-off technique. Pulling-off, however, involves plucking an individual note and then removing the finger used to play that note from the fingerboard so that another note is heard without having to pluck the string again. Like a hammer-on, a pull-off makes the sound of your guitar solos smoother and improves speed. When practicing scales with a hammer-on, it may be useful to hammer-on while moving up the scale and to pull-off on every other note while moving back down the scale. Learning each technique at the same time will greatly advance your playing proficiency, particularly when it comes to picking.