what sampling rate and bit depth should i use? I'm doing a simple mini project on FPGA board, electronic lock which open when a short track (the "password") is play next to the lock's mic.

i want to save samples of the chosen song to an array x[n]
and and then take samples from the mic and save them to a FIFO list y[n].
then compare the the conv result z[n]=x[n]*y[n] and when it is big enough the lock is open.

the question is how many samples i need for 3-4 sec of rock song for this purpose?
The typical audio sampling rate is 44 kHz, so you would need between 130 000 and 175 000 samples.
In practice though, it depends on the sampling rate you use on your FPGA. You can lower, but you will need to low-pass your signal before sampling it to avoid aliasing.

Note that if you put a threshold on z[n]=x[n]*y[n], it will not be invariant to volume differences.