Encrypt data. Create 5 keys. Just 3 keys are needed for decryption I would like to encrypt some data and create 5 keys. These keys are stored in different places. If I want to decrypt the data I just need 3 of these 5 keys.

Is there a way to do this?
Yes, there is.  And it generalizes easily to requiring any $k$ out of $n$ keys, not just 3 out of 5:


Generate a random key for some symmetric encryption scheme (say, AES-SIV).
Encrypt your data with that random key.
Use a threshold secret sharing scheme such as Shamir's secret sharing to split the random key into $n$ shares, such that any $k$ of them are needed to reconstruct the key.


You can use those $n$ shares directly as the $n$ "keys" to be stored in different places.  However, if you'd instead prefer to use $n$ pre-existing keys, you'll need one more step:


Encrypt each share with one of the $n$ keys (using whatever encryption scheme you prefer, either symmetric or asymmetric) and store the encrypted shares alongside the encrypted data from step 2.


To decrypt the data, do the same in reverse: first decrypt at least $k$ of the shares (if needed), then reconstruct the random key from those shares, and finally decrypt the data using the random key.

Shamir's secret sharing is unconditionally secure, so the whole scheme is as secure as the encryption schemes you use in steps 2 and (optionally) 4.