I just started playing bass guitar one month ago and my bass teacher told me that I should rest my thumb on the pickup. The problem with that is that my thumb slips off the pickup when I play. I find it way more relaxing to rest my thumb on the low B string (I have a 5 string bass). Is that ok too or should I rest my thumb on the pickup?
The most conventional sounding answer would be to rest it on the thumb rest...
Seen in the picture above! As leftroundabout points out in the comment, not many basses actually have thumb rests, although a variety of styles are available as aftermarket products.
It's often good to rest your thumb on the string below the one you're playing, when playing fingerstyle, because it helps with muting - so if you're playing the A string, you might often rest your thumb on the E; if you're playing the E string on a 5, the B string may indeed make an excellent thumbrest. Of course if you then want to play the B, you might want to use the edge of the pickup if you don't have a thumb rest (playing over the pickup also sounds quite good too.)
Of course there are almost no hard and fast rules, apart from 'don't hurt yourself'!
The thumb is another available digit with which to play notes! You're hardly going to pluck the pup! A lot of players (inc. me) will rest thumb on the lowest string, but it doesn't actually have to rest anywhere. One good reason is muting, to stop unwanted noises. Another is that the thumb can play that string, if needed. To be fair, that low B doesn't usually vibrate in sympathy with anything, but the thumb needs to go somewhere while it's hanging about, so that's a good place. Obviously you're not using a pick, so your other fingers come into play. I hope you are trying to use them all, as eventually it'll benefit your playing.
Resting your thumb on the pup also restricts where you pluck the strings. Yes, it sounds good there, but for tonal variety, try moving closer to the bridge, further towards the fingerboard.
Please question your teacher, but I doubt a convincing reason will be offered. I expect my students to question everything. I do! And can't come up with any justification your teacher may have to offer. The old 'thumb rest', as topo morto mentions, is a rare sight these days. I think it was one of Leo's ideas, but soon became redundant. Most people took them off their Fender basses, along with the plate over the bridge and/or pup., I seem to remember.
Check out this YouTube, I found it very helpful.
I'm a long time guitar player that started playing bass a few years ago. In the last year I've gotten more serious about my bass playing and had been looking for advice on technique, I found these YouTube's quite he!pful. I do a combination of resting on the pickup, the end of the neck, or floating. Depending on the music I'm playing.