Developers make good money. In some parts of some countries, they earn very, very much.
At the same time, average developer salaries in most places are not outstanding. Programmers don't get a percentage of sales and rarely get options from their company.
All in all, a good programmer can be sure to feed themself and their family and is unlikely to really need anything. But if you take the average temperature, there is no major financial success hidden in the very fact of working as a developer.
To become a developer for the sake of big money one should be ready not only to become an expert in the technical component, but also to acquire the skills of self-promotion, marketing, copywriting, eloquence and a dozen of others. This is why it's best to go into programming not just for the money, or not primarily for the money.
Mentors opinion
Wealth is most often defined as the amount of money that would allow you not to work another day in your life.
Can your current job as a hired programmer allow you to form such a stockpile? What kind of job could allow you to form this "wealth" and what competencies are needed for such a job? If not a job, then what set of circumstances can help you achieve this goal? Do you have to be a programmer to do it?
By answering these questions, you can build a path for achieving wealth, but it will not necessarily coincide with the path of becoming a programmer.