How many keys are required for two people to communication via a cipher?

That depends on whether you use a symmetric (shared key) or asymmetric (public/private key pair) algorithm.

If you use a symmetric key, it means both people have the same key which has been pre-shared via some secure means. In that case, only one key is required; both parties in the communication use the same key to encrypt and decrypt all messages.

If you use an asymmetric key algorithm, it takes at least 4 keys total: when sending a message each user will encrypt their message with the public key of the recipient (that accounts for two of the keys). Each recipient must then use their private key to decrypt the messages they receive (which accounts for the other two required keys).