Habit is all about the relationship between repetition and automaticity. If a person starts a new behaviour and repeats it every day how long does it take for that behaviour to become automatic (habitual).
A person smokes marijuana everyday for a year. He then stops smoking marijuana = the new behaviour. How long will it take for the non smoking to become habitual or automatic. The answer is that there is not a linear relationship between repetition and automaticity. Instead the relationship results in an asymptotic curve as shown in this diagram.
The early days of the repetitions result in a quick increase in automaticity. After a time this slows and there is a plateau effect in the automaticity where more repetitions result in little increase in the automaticity.
A behaviour is generally regarded as fully habitual when a person reaches 95% of asymptote. A 100% is when further repetitions result in no more increase in automaticity and there is a complete plateau. Research suggests that the time to reach 95% of asymptote takes 66 days. There can however be considerable variation with a range from 18 to 254 days.
Hence it can be said that for one to become a fully habitual non marijuana smoker will take 66 days. At that time the fully formed habit assists the person not to smoke marijuana again.