They say that forming or breaking a habit takes about a month of constantly sticking to it.
This may be true for new, pleasant or neutral habits, where the main challenge is finding the time to do it. It may even be true for breaking a bad habit that has no intrinsic reward.
But realistically, building a new, good habit that goes against character or against immediate gratification requires constant attention for the rest of your life and can be broken by neglecting it even one time. The same goes for breaking a bad habit -- one slip and it's back.
It can be done. Just don't expect it to be easy.