The length of time one will last depends upon treatment. Since they are usually more than simple fluid-filled ‘cysts’, but more like infected pustules, the infection needs to be treated. Your veterinarian will need to drain the fluid and likely prescribe antibiotics (usual treatment).
If left to their own devices, and never treated, these cysts could become worse rather than ‘go away’. It is the infection that needs to be treated; the cyst is simply more like a ‘symptom’ caused by the infection.
If drained and bandaged, the bandaging might need to stay on from 3-6 weeks. This depends on the size and severity.