The transition gamma*(q_1)gamma*(q_2) -> \pi0(p) is studied within the QCDsum rule framework. As a first step, we analyze the kinematic situation whenboth photon virtualities are spacelike and large. We construct a QCD sum rulefor F(q_1^2,q_2^2) and show that, in the asymptotic limit |q_1^2|, |q_2^2| \to\infty, it reproduces the leading-order pQCD result. Then we study the limit|q_1^2| -> 0, in which one of the photons is (almost) real. We develop afactorization procedure for the infrared singularities ln(q_1^2),1/q_1^2,1/q_1^4,etc., emerging in this limit. The infrared-sensitivecontributions are absorbed in this approach by bilocal correlators, which canbe also interpreted as the distribution amplitudes for (almost) real photon.Under explicitly formulated assumptions concerning the form of theseamplitudes, we obtain a QCD sum rule for F(q_1^2=0,q_2^2=-Q^2) and study itsQ^2-dependence. In contrast to pQCD, we make no assumptions about the shape ofthe pion distribution amplitude varphi_{\pi}(x). Our results agree with theBrodsky-Lepage proposal that the Q^2-dependence of this form factor is given byan interpolation between its Q^2=0 value fixed by the axial anomaly and 1/Q^2pQCD value dictated by the asymptotic form of the pion distribution amplitude.We interpret this as an evidence that the latter is rather close to theasymptotic form.