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)