There's a pretty common myth that it takes 21 days to form a new habit. This is actually not true, but you'll find a lot of sources on the internet that use that number.
Research has shown that it takes around 66 days on average, to form a new habit and after that point, the habit should become almost automatic.
I'm using research from Phillippa Lally to come to this conclusion. Here's a link to the paper's abstract:
The 66 days number is just an average though, the exact number of time it takes depends largely on how complex the behavior is that you're trying to change/learn. The study above found that it takes between 18 days to 254 days to learn a new habit, with an average of 66 days.
I've always heard it takes 21 days to break a bad habit but according to what I found when looking up this question it appears to be outdated
Consider the 21-day rule, whose roots go back to the 1960s pop psychology book Psycho-Cybernatics. This book says it takes a minimum of 21 days for an old mental image to dissolve and a new one to gel.
More recently, a study of 96 people published in The European Journal of Social Psychology found it took on average 66 days to form a habit, such as eating fruit at lunch or running for 15 minutes a day. But in the study, the actual number of days ranged from 18 to 254 days - indicating that it can take a very short or a very long time!
It's quite easier to learn a bad habit than to stop it. Though with conscious and consistent effort, one can stop a bad habit.
Habit develops from something you do often, therefore the easiest way to replace a bad habit by a good one is to do or practice the good habit consistently. The more you practice the good habit, the more the bad habit becomes powerless.
I can't tell you how long you would need to practice the good habit to replace the bad completely. Just continue practicing it.
It all depends on how bad the habit is and what it is. If you know what it is and want to shake it and made an effort I am sure it would take someone 2 to 3 months to sort it out.
Smoking is a bad habit and it is addictive. It could take a few days as you just stop or it could take a few years. I stopped smoking for about 4 months and like an idiot had a cigarette the one day and bang i was smoking again. I did it once and can do it again but your mindset needs to be right.
If you are strong willed yo can beat any bad habit and I know i have a fight coming up again soon as I am ready to quit once more. I know by January/February I would have quit the habit but have not put a number of days on it as it takes time to wean off the nicotine.
I believe bad habits can be changed with work. The time needed for changes can vary depending on the habit, and how ingrained into the person's brain the pattern is.
Neuroplasticity, also known as brain plasticity and neural plasticity, is the ability of the brain to change throughout an individual's life, e.g., brain activity associated with a given function can be transferred to a different location, the proportion of grey matter can change, and synapses may strengthen or weaken over time .