I've quit caffeine several times and the headaches were all gone after 2-3 days, with the other symptoms such as low energy and brain fog gone within a week or two.
Caffeine withdrawal is quite forgiving. The problem (at least for me) is not coming back to it months afterwards.