As others have said... as long as it takes.
My band doesn't really rehearse (maybe 4 rehearsals a year), but we add new songs regularly. For me (and everyone in the band) that means we practice them on our own until we don't get them wrong. Some songs, that could be in a single listen in less than the actual time of the song (something like Stand by Me). Other songs, that could mean a couple of days listening and going over them (something like The Killers - Somebody Told Me).
Being that ya said you're a newbie, I'll offer this suggestion. Its best not to compare your progress with anyone other than yourself. A few years ago it took me twice as long to learn a song as it does now. The more we do it, the better we get.
And another tip I wish I had stumbled upon decades ago. Try learning songs without your bass in hand. No matter how much you suck at it

. Listen, and try to imagine where the notes would be on the neck. After doing it for a while to the best of your ability, even if you're 100% off - pick up the bass and learn it. By doing this over and over we start to really train our ears. Do that for 100 songs and I promise you'll be well on your way to learning tunes by just listening to them. And you will make far less mistakes when performing. Your fingers kind of just learn where to go.