Good question. We refer to the intervals using the standard diatonic scale (major scale) as the model. The intervals within the scale would be major intervals except the 4th, 5th and 8th (octave) which are known as "perfect" intervals.
Here is an example: beginning with the root of the major scale we have the following intervals; major 2nd, major 3rd, perfect 4th, perfect 5th, major 6th, major 7th, perfect octave.
If you flat a major interval by a half step it becomes a minor interval. If you flat a perfect 5th it becomes a diminished 5th (b5) {This can also be referred to as an augmented 4th (#4)}
Using the diatonic scale better describes the intervals and how they sound to us.
In technical terms you can diminish any perfect interval BUT a diminished octave is the same relationship as a major 7th. Likewise, a diminished 4th is the same thing as a major 3rd.
So a major 2nd that has been flatted is a minor 2nd, a major 3rd that has been flatted is a minor 3rd, etc. This allows us to name all or the intervals within the chromatic scale too. We still use the numeric relationship of the major (diatonic) scale but by calling an interval major, minor, diminished, or augmented we can accurately describe all of the intervals.
Using the chromatic scale we would have the following order of intervals; [root,] minor 2nd, major 2nd, minor 3rd, major 3rd, perfect 4th, diminished 5th (or augmented 4th) perfect 5th, minor 6th, major 6th, minor 7th, major 7th, perfect octave.
This can be a little confusing at first. You may want to enlist the help of a teacher or tutor to help you with this.