There are a few things which render a melody particularly memorable:
1)The mood it evokes.
Many of us enjoy good movies, and extraordinary movies often feature memorable music. During crucial scenes, it is often the accompanying music that inspires the audience with the necessary emotions to become further invested in the plot. Very often, major characters in a movie are endowed with their own music theme when they appear in scenes. Thus, the audience comes to associate a certain melodic progression in a song with the character in question. In other words, the melody becomes part of our sensory experience while we follow the story. The melody moves us to feel.
Take for example, the character of Jason Bourne in the Bourne series. He's a spy framed for a crime he didn't commit. His theme song is frenetic in rhythm and punctuated with urgent, staccato beats. Very often, this song is played when he is being chased by unknown assassins who are out for his blood. Thus, the intense, energetic melody in Jason Bourne's theme is memorable because it embodies the nature of his struggle for redemption and vindication.
Hear the Piano Guys take on Jason Bourne's theme here.
2)The motif becomes the prominent feature of the melody.
The motif of a melody is usually made up of a few, repeated notes. In other words, this motif is a little musical 'idea' that comes up repeatedly in a piece of music.
It is also combined with shorter and longer melodic phrases that add to the character of the piece. One of the most famous classical symphonies, Beethoven's Fifth, is readily recognizable the world over because of its iconic melody. The four note motif (G-G-G-E flat), played in three successive, short bursts and ending in a long, ominous tone, has become so popular that it is used in movies, advertisements, and plays.
Interestingly, the story follows that, during World War II, this four note motif was associated with the Morse code for victory. Read NPR's article about Beethoven's famous four notes.
3)Memorable melodies use specific chord progressions.
Many strong chord progressions involve the fourth and fifth chords.