To add to Philipp's answer:
It's neither secure, nor can it be made secure, no matter how much effort you put into it.
But you can make it easier to deal with problems. If you store the key in an external file instead of somewhere in the code of your program, it's much easier to change. So while you can't protect the key from being stolen and the data from being decrypted, you can make it easier to regularly change the key, so that an attacker must periodically regain access to the key if he wants to keep reading the encrypted data. This increases the chances of being detected (he might trip over some kind of intrusion detection system sooner or later, or make a stupid mistake)
Separating key and application also makes it easier to protect the key - now you only have to protect a small file and don't have to worry about where the application binary and source code might be stored (think version control systems, package managers, automated build environments, backups etc).
Keeping the key in an external file is also a good idea because depending on which platform you're running on, your application can start with elevated permissions that allows it to read the key, and then drop these permissions so that while it's running, it won't have access to the stored key any more. This will prevent a few types of attacks, even though a sophisticated attacker can of course always pull the key from the application's memory.
Depending on what your application does, it might also be possible to reduce the attack surface significantly. If one part of the application only ever writes secret data, you can split your application into two parts and use public key cryptography to stop having to worry about the first application, the one which only needs to write data, but not read it back. In that case, you give the first application a public key to encrypt a session key with, which you use to write the secret data. Now you only have to protect the second application, which reads the data back, or rather, the private key this application has access to.