In general, I can hear and playback about seven notes, perhaps a bit more if I have listened to the song before.
Listening to the song more than three times does not help to figure out the note sequence.

At that point, I have to break it apart to figure it out. If the sequence is complex, meaning it is fast and contains many note values, sometimes I can loop it, but most of the time, I have to find the standard notation to figure it out.

I now have software called Synthesia, which is also useful but requires converting the song to Midi.

Some note sequences are a bit less trouble to remember, such as those in a scale that I recognize.

Recognizing chord progressions is pretty easy for major and minor chords, major 7th, dominate 7th, and most of the time, 6th chords. Other chords, like flat five or #9, are much more difficult for me to recognize.

My memory ability seems to change with age. From the 1950s forward, I can remember the melody and some of the lyrics to a large number of songs that I listened to on the radio but never played.

Certainly, things that stay in key are less trouble, but I think this has less to do with memory than having a good idea of what may come next.

I think it would be unusual for most nonmusicians to be able to remember more than a few notes.

As Trev said, there are people who have the ability to listen and repeat music note for note. I think those people fall into two categories: those who can do that naturally and those who learn to do that after much study.

Billy