It's a toss-up between The Godfather and Goodfellas. I think you can make the case either is better, because they're both masterpieces. Goodfellas is a lot more fun, but that doesn't necessarily make it better, while Godfather feels like this incredible journey if you're in the mood to get lost in a story.
Then The Godfather Part II (it is smarter and more confidently made than the first Godfather, but it's just a lot more depressing).
I never really cared for The Sopranos or, obviously, The Godfather: Part III. You should throw Scarface into this too though.
A ranking of modern(ish) gangster movies:
1. The Godfather/Goodfellas
3. The Godfather: Part II
4. The Untouchables
5. The Departed
6. Scarface
7. Gangs of New York
8. Casino