Confirmatory factor analysis is a statistical method that tests whether a measurement model you specified in advance fits your data. You state, before looking at the results, exactly which observed items load on which latent factor, and the analysis tells you how well that hypothesized structure reproduces the relationships in your data. It is the standard way to validate that a questionnaire measures the constructs you claim it measures.
The defining feature is the word confirmatory. You are not asking the data to suggest a structure. You are testing a structure you already believe in, usually because theory or a previous study proposed it. This is what separates it from exploratory factor analysis, where the number of factors and the pattern of loadings are discovered rather than imposed.
When to use confirmatory factor analysis
Reach for confirmatory factor analysis when you have a clear hypothesis about your measurement structure and want to test it. The most common situations are validating an established scale in a new population, confirming a factor structure that an earlier exploratory analysis suggested, or establishing the measurement model before estimating relationships among constructs in a larger structural equation model.
If you do not yet know how many factors your items represent, confirmatory analysis is premature. Run an exploratory analysis first, then confirm the resulting structure on a fresh sample. Testing and confirming a structure on the same dataset that suggested it is circular and will not convince a careful reviewer.
What the model specifies
A confirmatory model fixes three things in advance. It fixes the number of factors, the assignment of each item to a factor, and which items are allowed to cross-load or share correlated errors. Every item is typically allowed to load on exactly one factor, and the residual variances, the part of each item the factor does not explain, are estimated as measurement error.
Because you impose this structure, the analysis can ask a sharp question: given that each set of items is supposed to measure one factor, does the pattern of correlations among all the items match what that structure predicts? The answer comes back as a set of factor loadings and a battery of fit statistics.