Some wallet has varying amount of confirmations needed before a transaction is spendable. But it usually takes up to 3 confirmations on a standard Bitcoin wallet before you can spend it. I think for electrum one confirmation can be spendable and the higher the number of confirmations you get on your transactions, the lesser the risk of it being reverted or double spent.
For exchanges, they require 1 confirmations to get your Bitcoin deposited and you would be. Able to spend them.( Also depends on the wallet address type you used on the exchange).
p=probability of the next block being mined by honest miners
Z= number of confirmations your transaction has received so far.