Deciding the number of clusters in K-means clustering of descriptors
Measure, don't guess

It appears to be common to try k=1024, 2048, 4096, ... and use what works best for classification.

This is possivle because the clustering is actually a quantization task, and you do classification afterwards.