A public key is used to receive bitcoin. When bitcoin is sent to a public key, only the owner of the corresponding private key will be able to produce a valid signature to spend that bitcoin. A public key can be analogized to a P.O. Box, where anyone can send mail, while only the owner of the (private) key can then access mail sent to that PO Box. Each private key has a single corresponding public key and vice versa. Publicizing a public key is perfectly safe, while a private key must be kept secret.
Public keys and addresses are often conflated. An address is usually a hash of a public key, and at present, addresses, not public keys are used to directly receive bitcoin. An address is merely an abbreviation of a public key used for convenience and security; it is the public key that is used to verify the signature and thus allow the bitcoin to be spent.
Bitcoin wallets are used to generate and manage public keys. To do this, a wallet first derives a private key, a large random number. Next, the private key is used to derive the public key. Finally, the public key is hashed and a prefix is added, yielding the address.