Funny, when I was maybe 10yo, I got scared when I realized that given the number of notes is finite, the number of different melodies would be too, and so we would have one day to put new lyrics on old melodies.
Since song have no time limit, and notes can be combined in numerous ways to form chords, there is no limit to the number of melodies. And that's before you consider musical temperaments.
Sure, there is no hard limit on the length of a song, but most are limited to <5min and based on a much shorter melody, just repeating in loop.
Now older than 10yo, I understand that there are additional variables that increase the number of possible melodies. Turns out lots of popular melodies only gravitate around 4 chords (https://en.wikipedia.org/wiki/The_Axis_of_Awesome)