Symmetric Encryption
If the same key is used to encrypt and decrypt data, we have a symmetric encryption algorithm.
Symmetric algorithms such as AES (the Advanced Encryption Standard) are fast, which makes them the workhorse of modern cryptography. They encrypt your disk, your database backups and, once a connection is set up, all the traffic in an HTTPS session. Their weakness is the key itself. Anyone who has the key can read the data, so the sender and the receiver need a safe way to agree on a key, and you need a safe place to keep it.
Asymmetric (or public-key) encryption solves the agreement problem with a pair of keys: a public key that anyone can use to encrypt a message, and a private key, held only by its owner, that decrypts it. Asymmetric encryption is much, much slower, however, so in practice systems use both. TLS, for example, uses asymmetric cryptography to agree on a symmetric key, then switches to symmetric encryption for the rest of the conversation.
Whichever kind you choose, use a standard, well-reviewed library, and never write your own encryption algorithm. (See randomness for one of the ways homemade cryptography goes wrong.) Store keys separately from the data they protect, in a key management service if you can.