I have an encryption app that just encrypts a string and then can decrypt also.. But how can I make it so the user sets a password and the other person has to put in that password to decrypt the message.
Based on the tags in your question (qt & c++), I assume you intend on using the Qt framework. Thankfully, there is a library available for Qt that can do this for you. And the best part is that the library is already included in the main archives.
The library I'm referring to is called QCA - Qt Cryptographic Architecture and is available through the libqca2 and libqca2-dev packages. You will also want to install the libqca2-plugin-ossl package, which provides runtime support for the OpenSSL functions.
Rather than going into a lot of detail on using the QCA library, I will instead point you to this example which demonstrates how to use the AES128 algorithm to securely encrypt a message with a passphrase and then decrypt it later with the same passphrase.