The goal of importance sampling is to estimate the expected value of a given function with respect to a probability measure . using a random sample of size n drawn from a different probability measure .. If the two measures . and . are nearly singular with respect to each other, which is often the case in practice, the sample size required for accurate estimation is large. In this article, it is shown that in a fairly general setting, a sample of size approximately exp(D(...)) is necessary and sufficient for accurate estimation by importance sampling, where D(...) is the Kullback.Leibler divergence of . from .. In particular, the required sample size exhibits a kind of cut-off in the logarithmic scale. The theory is applied to obtain a general formula for the sample size required in importance sampling for one-parameter exponential families (Gibbs measures).