A delay unit repeats a note that is played.

The Edge is famous for using an effect to the maximum benefit in a song.  That is especially true for delay.  As you learn U2 songs you may be surprised by how few notes he actually plays in some songs. That is because he lets the delay unit repeat notes for him. 

There are two ways to use delay 1). to create discrete echoes between played notes (delay is >100 ms) or 2). to "thicken" the sound of played notes (delay is 20-100 ms).  I'm going to ignore uses <20 ms here.

Delay and Tempo
The trick to using delay in the first way is that the delay unit is setting the tempo of the song.  The song is now effectively a duet.  If the player is just a little too fast or slow the sound will become tangled.  In a concert you often hear the edge play just one or two muted strokes before a song starts.  He is orienting himself with the delay.  Since tempo is now set by the sound of the lead guitar, not the drummer, Larry must listen closely to the Edge (and perhaps a metronome) to keep the time correct. That is why songs of this type start with only guitar then the other instruments join in after a few measures (Where The Streets, I Still Haven't, All I Want).  The edge is synching with the delay then the others are synching with him.

Songs that can use delay
Any song using notes that go together, members of a chord, lends itself to using discrete delay because the notes overlap in a pleasing way. Also, moving between the major and minor of any chord sounds good. This riff makes use of those ideas.

Calculating Delay
There are 60,000 milliseconds in a minute, so divide that number by the BPM (beats per minute) to get the length of a quarter note (for a 4/4 song). Further divide that number to get the length of smaller notes such as 8th, .8th, 16th, .16th, etc.  A dotted note is 50% longer then its regular counterpart. So a dotted quarter note is a quarter note plus an eighth note (3/8 of a beat). A dotted eighth note is an eighth note plus a 16th note (3/16 of a beat), and so on.

Delay settings
On a delay unit 'Feedback' means how many times each note is repeated (they trail off in volume). 'Mix' is how loud the repeats are compared to the original note.  A mix of 50% or "noon" means the echo is as loud as the played note. 'Modulation' refers to an effect that constantly varies the pitch of the repeated note(s) but not the original note. That creates a rich 3D sound.  There are many different algorithms for modulation.  I believe The Edge typically used triangle sine modulation. If using stereo output, use a ping-pong setting which will pan the delay signal back and forth between the left and right channels to create a 3D effect.

More info
Above are the basics. In reality The Edge uses multiple delays at the same time sometimes inline and sometimes in split signal paths. If you want to learn more, Tim Darling wrote a very detailed study of how the Edge uses delay.