A sequence is a pattern - or "figure" - within a
piece of music which directly repeats itself (often several times),
not at the same pitch (this would be a true repetition), but at
a higher or lower step in the scale.
Some examples of sequence
A: MELODIC SEQUENCE:
In this example the
musical pattern or figure formed in the first bar (x) is repeated
starting on D (one note higher) in the second bar (x2) and repeated
one note higher again, starting on E, in the third bar (x3). To
bring the melody to a close the fourth bar is different leading
back to the keynote C. The sequence used is an ascending sequence.
B: MELODIC SEQUENCE:
In this example there
is no sequence in the first two bars. The first four notes of
the third bar form part of a descending scale of C in 1/8th notes
(y). This is then repeated starting on A, two notes lower (y2)
and repeated again starting on F, a further two notes lower (y3).
Notice that in y3 there is a small change at the end of the pattern
to make the approach to the final note C sound more convincing.
Because y3 is not quite the same pattern as y and y2, it is known
as a modified sequence. The sequence used is descending
and modified.
C: HARMONIC SEQUENCE:
Here are the chords which are formed in
C major extended over 2 octaves.

In a harmonic sequence the pattern will be formed by changes of
chord, rather than of patterns in the melody.

Note that this same harmonic sequence -
particularly with 7ths added to the chords here - is much
loved by jazz and rock musicians:

D: SEQUENCE OF KEY CHANGES (SEQUENTIAL
MODULATION)
This is usually defined by a series of V to I progressions.
Each time this harmonic pattern recurs a new I chord (
and therefore a new key) is reached. The interval formed between
the tonic (I) notes of the first and the second figures is maintained
when the figure is repeated for a third or fourth time. 
In bar 2 Eb major is reached. Two bars later, the key changes
back to Bb major - a 4th lower. The next key change is a 4th lower
still (to F major two bars later). A final "repeat"
of the figure takes us a 4th lower still - to C major at the end.
Bars 1, 3, 5 & 7 are all dominant (V) or dominant seventh
(V7) chords which lead on to the new tonic (I) chords of the keys
reached on each sequential repeat.
Useful Information:
There are two more meanings of the word sequence used in music: