I wanna know cause im a newbie programmer and want to code for myself someday
tl;dr It's different for everyone, but gets easier the more languages you learn.
As much as I would like to give you a specific timeframe, the hard truth is that it completely depends on the level of understanding that you want to achieve. If you're looking to learn syntax, it might take a month or two at max but learning programming itself takes years upon years. From personal experience, I would say to avoid looking at programming as something to learn in a timeframe but rather to take it up as a hobby. This answer is a bit short but if your looking for something more in-depth, I wrote a tutorial a while back on learning programming here