This is not usually an indication of a mental disorder. It could be that you were a particularly imaginative and creative kid, and it was your way to create stories that you were too young to write down. If you were lonely as a child, it’s possible that you started talking to yourself as a way to have “friends” to play with. Or another possibility is that you were criticized for not doing things “right” and found that talking things through, step by step, helped prevent you from making mistakes. Or it could be something else. Without knowing you, I can’t give you a definite answer about how it started.
I’m not convinced you need to stop telling yourself stories unless it is making it difficult to be around other people. If you can keep it to yourself and you enjoy it, it may not be a problem. It’s just part of the quirkiness that makes you you.
If you do want to stop it because it is giving you problems socially, then what to do depends on the reason it started. If you are creative, you could start writing your stories or finding other ways to express yourself. If you are lonely, maybe you need help learning how to make friends. If you are scared you’ll make mistakes, you need reassurance that mistakes are only human.
If this habit is troublesome to you, I suggest you see a counselor for a few sessions to help you understand how the habit is useful to you and how to reduce it by finding new ways to deal with whatever is at the root of the problem.
I wish you well.