Playing the guitar or bass is very much an exercise of coordination or synchronization. Your right hand must be synced with your left hand, your pick must be synced with the strings, your left hand must be synced with the strings and the frets and your playing has to be synced with the band and the tempo.
In the same way that when you tap your foot, it's down on the beat and up on the ands, (the off beat) your pick too should generally be down on the beat and up on the ands, especially when playing eighth notes. This reinforcement of both your foot and pick being down on the beats and up on the ands will eventually lead to a strong sense of where the beat is, which is critical to becoming a competent musician.
Alternate picking (picking down and up) needs to be practiced to the point of automaticity. A caveat with picking down on the beat and up on the ands occurs with quarter notes – I recommend that beginners play quarter notes with alternate picking which puts the down picks on beats one and three and the up picks on beats two and four. Once you've gotten to the point of alternate picking being completely subconscious, then you can play slower quarter notes with down pick.