The first stage of withdrawal is characterized mostly by the physical difficulties, and it can last up to a week. But then there is a longer period, called post acute withdrawal syndrome, that can last longer. It can depend on the person but some estimates are that the cravings, anxiety and other feelings can go on for weeks and months.
Do you have any kind of support program? Talking to a therapist for ex can help.