The quick answer to this question is that if you're fully dedicated to learning web design, you'll be on your way in 1 or 3 years. I'll even say that less than a year is possible if you dedicate 1000% of your efforts to learning this, but if you want to slow down, the average is 2 to 6 years. Depending on the educational path you choose, you may need more or less time to achieve your goals. If you rely on self-directed online learning, you may want to prepare for a year or more to make the transition.
In addition, if you want to embark on a dedicated and structured educational path, but need to manage your personal responsibilities, you may want to have more time to become a web developer. I changed my career from psychology to web development. I started learning last August and, at the end of the year, got an apprentice position as a developer of SFCC (core JavaScript on the back with some features ahead with TypeScript). Yesterday I received notice that I had successfully passed the trial period, so right now I'm a junior developer.