Your question is much like "how long is a piece of string". Different people will learn at different rates. Some people already think the right way to excel at programming and some people don't. How you're learning and where you're getting your information will make a difference too.
Programming is about using constructs that you are already familiar with in unfamiliar situations. There are fundamental building blocks, like branches and loops, that you must learn first, then you can combine them into new combinations to do new things.
Programming doesn't exist in a vacuum though. Some people abandon the logical principles that they've used their whole lives as though programming works differently. It doesn't. Code is just an implementation of logic. Work out the logic first. Work out the steps your code needs to perform and then, if necessary, write them down. As you write your code, continuously compare it to that algorithm to confirm that it is doing what it should, nothing it shouldn't and in the right order.