Should I always lock my bitmap before drawing everything on them?
No, not at all. All drawing operations are executed directly on the GPU. When you lock your bitmap, what happens is that the bitmap's memory is mapped to the CPU. Obviously you don't need that. Since drawing operations happen on the GPU, you also want your memory on the GPU. Depending on how you set up your bitmap, locking needs to copy data from the GPU to the CPU all the time, so it could even slow down your application dramatically when called too often.
The reason you need to lock your bitmap at all is because al_put_pixel is not a drawing operation. It instead just directly modifies the pixel data in the memory of your bitmap. To do this, it needs the bitmap on the CPU, though, and because of this, al_put_pixel locks and then unlocks your bitmap whenever it's called, so naturally, if you call it too many times, it causes the bitmap to be locked and unlocked many times, which means a lot of data will be sent back and forth between GPU and CPU, causing major slowdown. By calling al_lock_bitmap before calling al_put_pixel, what basically happens is that you map the memory to the CPU in advance and tell al_put_pixel not to lock and unlock the bitmap itself, therefore you can call al_put_pixel on the same bitmap multiple times, but the bitmap will only be locked and unlocked once and therefore it will only get data from the GPU once and send data back to the GPU once, potentially speeding up the process a lot (depending on the situation).
You can speed this up even more by only locking the bitmap for write access rather than read/write access. That way the application doesn't have to read data from the GPU to the CPU (which is quite slow), but only has to send data from the CPU to the GPU. So if you don't need to preserve the contents of your bitmap, it is a good idea to set this flag. Also, if you recreating your bitmap every frame, you can speed up locking of your bitmap even further by specifying a certain flag on your bitmap. I think it's called "discard" or "no preserve" or something like that.
Now whether you use al_put_pixel or al_draw_pixel usually depends on the situation. If you're only drawing a few pixels onto the bitmap, then al_draw_pixel is usually the better choice, because few draw calls barely matter for the performance at all, especially when they're only drawing small 1-pixel-quads. If you're drawing a lot of pixels, though, and especially if you're modifying ALL pixels, then al_lock_bitmap + al_put_pixel is usually the better choice, because, while it needs to move a big memory block from/to GPU, it only needs to do so once, rather than sending thousands of individual draw commands to the GPU. So in this case, the al_put_pixel approach could actually be faster.