Start by finding a familiar song that starts with an interval you want to memorize. For instance, the theme from "Jaws" is a minor second. This will help you in the beginning when you are just learning the intervals. With practice, you will be able to stop relying on these tricks to identify intervals. In the resource section, there is a link to songs that begin with each major interval.
Compare the interval of a perfect octave to a perfect fifth. These are two of the most commonly used intervals. To compare intervals, use a computer program or record yourself playing several intervals on a piano. Play these intervals back and listen to them to see if you can identify the difference between an perfect octave and a perfect fifth. When you can accurately identify 15 intervals in a row, move on to the next interval.
Compare the intervals of a perfect fifth and a perfect fourth. Once you can accurately identify each interval 15 times in a row, add the interval from step 1.
Compare the intervals of a major third and a minor third. After memorizing these intervals, try playing through all the intervals learned so far.
Continue comparing intervals in groups of two and then adding them to the combined set until you have memorized all of the intervals in an octave. The remaining sets of intervals should include: major and minor seconds; major and minor sevenths; tritone, major and minor sixths.