Usually when someone talks about the greatest of the Mario games, either Super Mario Brothers 3 or Super Mario World are argued for.
Sure, there is the occasional person that throws Mario 64 or the original Super Mario Bros into the mix, but generally I think Mario 3 and World are the two best of the pre-2000 core-Mario games.
If I took an official vote, my bet would be that Mario 3 is the overall favorite.
It was the first game with the diverging paths world map, insane amounts of secrets, memorable boss battles, and that ridiculous combo of the maze like world 7 and difficult world 8.
I sat cross legged, challenging myself to beat the game without using whistles and saving that P-wing until the flying fortress level for several years.
Mario was fine tuned and indeed, Mario 3 is probably the best game on the NES, but I always tend to have a soft spot for Super Mario World.
It's partly because I didn't actually own a SNES and didn't get as much time with Super Mario World. There was a point where I did have some Mario 3 fatigue.
Super Mario World has its own bullet-ed list of features that could go bullet for bullet with Mario 3, like an even larger world map, more secrets, the introduction of Yoshi in a Mario game, and a diverse set of levels.
But I think it's more about the social aspects of the game. I remember setting up a 27" standard definition television on the bottom bunk of my cousin's bunk bed, his window open allowing the crisp autumn air to blow against our shirtless bodies, and draping sheets over the outside to give us a cave to fully escape into this other world. (It sounds like some pre-teen, homoerotic adventure now that I've typed it out)
We would scream, laugh, talk about small world's issues, discuss what we were going to blow our allowance on, and beg his mom to order us pizza.
It was a game that couldn't be beat in one weekend. We grew with the game. Sure, we might have beat Bowser after just a couple weekends, but that 55% completion on the save screen mocked us. We spent months finding all of the secrets we could, until we were forever stuck on the 5th Special level.
Eventually we noticed girls and more adult oriented video games like Resident Evil took over our Friday-post-roller-skating-game-nights. Super Mario World was packed into a box and largely forgotten about. It wasn't until last fall when I was given a family member's SNES and about 15 games that I remembered the magic.