Is there any formula to apply extended chords just like triad chord (IM-IIm-IIIm-IVM...like this). Thanks..
If by 'extended chords' you mean adding fourth voice to the triads then sure there is:
Imaj7 IIm7 IIIm7 IVmaj7 V7 VIm7 VIIm7(b5)
You simply stack another third on top of your triad that belongs to a given key. If you mean the actual extended chords beyond seventh then the procedure is still the same - just keep stacking diatonic notes.
To expand on Jared.D's answer. Diatonic chords are chords where all the notes belong to the key you are in.
The reason we use the notes we do to form the diatonic triads is because those notes all belong to the key, stacked in diatonic thirds.
For example the key of c is made up like this
C D E F G A B C
To spell a C chord in this key we start on c, skip a note then E, skip a note and then G.
That turns out to be major.
The next chord is a d chord. D, skip, F, skip, A.
That turns out to be minor. Due to the F natural and not F# (minor third interval between 1 and 3)
If you continue that pattern you get the triads you mention.
Now, for 7ths you can just skip another note and add a 7th of some flavor, determined by the diatonic note in the key you are in.
The I (one) chord would be C E G (skip a note) and then B. This a major 7th chord. Cmaj7.
D would be D F A (skip) C. ii-7 (2 minor 7).
The rest of the chords are:
Imaj7 ii-7 iii-7 IVmaj7 V7 vi-7 vii-7(b5)
Note minor chords get lower case letter. The dash denotes minor 7th. Major 7ths get a "maj". The dominant 7th just get a "7".