I know its been a while, but I'd like to answer this using a different approach, although the current answers are technically remarkably well constructed.
I know that their defined in relation to their scale.
That is not entirely true. There are two ways to view modes, depending on how you want to use them. I will avoid the pattern approach because I think its more important to understand what Modes are supposed to do and how to use them before attempting to nail down a definition. I assume you know what all the Major Scales are and how to derive them. I also assume you know what a key signature is distinct from a root note.
For reference purposes in the examples, the 12 Major Scales are listed below.
A Major: A B C♯ D E F♯ G♯
B♭Major: B♭ C D E♭ F G A
B Major: B C♯ D♯ E F♯ G♯ A♯
C Major: C D E F G A B
D♭Major: D♭ E♭ F G♭ A♭ B♭ C
D Major: D E F♯ G A B C♯
E♭Major: E♭ F G A♭ B♭ C D
E Major: E F♯ G♯ A B C♯ D♯
F Major: F G A B♭ C D E
F♯Major: F♯ G♯ A♯ B C♯ D♯ F
G Major: G A B C D E F♯
A♭Major: A♭ B♭ C D♭ E♭ F G
Given a Major Scale key sigature, you may want to -
1) change the root note (key signature), but keep the notes of the orignal scale.
2) keep the root note (key signature), but change one or more notes in the scale.
In this example we will use the C Major Scale and the Dorian mode.
The notes in the C Major scale are: C D E F G A B
The Modes are, for each note position:
Ionion Dorian Phrygian Lydian Mixolydian Aeolean Locrian
In case 1) above, we change the root note from C to D, so the D Dorian mode is: D E F G A B C
All the C Major scale Modes are:
C Ionian: C D E F G A B
D Dorian: D E F G A B C
E Phrygian: E F G A B C D
F Lydian: F G A B C D E
G Mixolydian: G A B C D E F
A Aeolean: A B C D E F G
B Locrian: B C D E F G A
As shown above, you can keep the C Major scale, but change its root. Changing the root does not change the scale, so D Dorian is not the D Major scale (D E F# G A B C#), but the D rooted C Major scale. Only the Ionian Mode is identical to the Major Scale because it is the scale's first position which defines its key, so D Ionian Mode is the D Major scale.
There are 12 Dorian Modes, one for each Major scale, but only one D Dorian Mode. The Mode notes are defined by the Major Scale of that note in that scale's position. So D Dorian Mode is the Major Scale with D in the 2nd position, which is the C Major scale.
A Similar method applies to all other modes. There are 12 Phrygian Modes, only one is D Phrygian and that is Bb(or A#) Major with D in the 3rd position (B♭ C D E♭ F G A). Also C Dorian is the same Bb Major scale, but with C root, not D. So C Dorian and D Phrygian are Modes of the Bb Major Scale that root it in C (2nd) and D (3rd), in the same way D Dorian and E Phrygian are Modes of the C Major scale and root it in D (2nd) and E (3rd).
In case 2) above, we keep the root note C and find another major scale with C in the Dorian, or 2nd position. This is Bb (or A#) Major, and that scale, starting from C, is: C D Eb F G A Bb
The C Modes are C Ionian (C Major), C Dorian (Bb Major), C Phrygian (Ab/B# Major), C Lydian (G Major), C Mixolydian (F Major), C Aleolian (A Minor), and C Locrian (Db/C# Major).
It is also possible to change up to six notes of the C Major scale. Whether accidently, or intended, each note can be found in all seven positions and only in seven of the 12 Major Scales. Thus, the C note can be found in seven scales at a different position. So, we don't actually change any notes, we find a major scale that has our key and the changed notes. The Bb Major scale has C in the second position with the E and B notes changed to Eb and Bb. Thus, C Dorian is equivelant to the C Major scale with a flattened E and B, but is actually the Bb Major scale with a D root.
Below is a list of all the C Modes (i.e. all Major scales rooted in C), in lowered pitch and increasing note change order, with the actual Major scale in (Brackets):
(G M) Lydian: C D E F# G A B [ ] 0
(C M) Ionian: C D E F G A B [F ] 1
(F M)Mixolydian: C D E F G A Bb [Bb] 2
(BbM) Dorian: C D Eb F G A Bb [Eb] 3
(EbM) Aeolian: C D Eb F G Ab Bb [Ab] 4
(AbM) Phrygian: C Db E F G Ab Bb [Db] 5
(DbM) Locrian: C Db Eb F Gb Ab Ab [Eb] 6
So, the C Lydian Mode is actually the G Major scale with C in the 4th position and can be used to change the key from G to C in G Major, or, for the C Major scale, used to change F to F#. Although the actual C Lydian Mode is specifically the notes given as listed above, its meaning depends on what changes it makes to your scale. And this, I suspect, is what creates the confusion.
C Lydian is G Major (with C root), but is associated with the C Major scale because it has the same key. So while C Lydian is not derived from C Major it is frequently used with it because the two scales are so similar. In contrast, C Locrian is derived from Db/C# Major scale and only has 2 notes (C and F) in the C Major scale and yet is still associated with it because it has the same key.
It is the way in which the major scales are reordered that the Modes establish the association between scales and enables composers, improvs, and Jazz performers to switch between scales, playing all the 12 notes and yet sounding like a seven note octave with subtle and not so subtle pitch changes, tweeking a mood the scale sets with one or more Modes.
If I may ask another but related question - I hear there are many, many modes out there, but how many are actually unique?
The Modes are generated from the scale, so you will be able to derive all modes from any pattern distinct from the Major/Minor by following the same formulas applied to the Major pattern. For example, the pentatonic scale (five note scale), will likewise have 4 key changes, and 4 note changes, which will be the pentatonic Modes. However, I don't think they have official names, so you can make them up, using the naming convention used for the Major scale. So, just as you can have many unique patterns, the modes will be similarly all unique.