Phlegm, the thick mucus that’s coughed up, typically lasts as long as the underlying condition. For example, if you have a cold, the phlegm may last for a week or two. But if you have bronchitis, it may take several weeks to months for the mucus to clear.