The transition gamma* (q1)gamma*(q2) -->pi(0)(p) is studied within the QCD sum rule framework. As a first step, we analyze the kinematic situation when both photon virtualities are spacelike and large. We construct a QCD sum rule for F-gamma*(gamma)*(pi)0(q(1)(2),q(2)(2)) and show that, in the asymptotic limit \q(1)(2)\, \q(2)(2)\ --> infinity, 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 a factorization procedure for the infrared singularities ln(q(1)(2)), 1/q(1)(2), 1/q(1)(4), etc., emerging in this limit. The infrared-sensitive contributions are Il absorbed in this approach by bilocal correlators, which can be also interpreted as the distribution amplitudes for the (almost) real photon. Under explicitly formulated assumptions concerning the form of these amplitudes, we obtain a QCD sum rule for F-gamma*(gamma)*(pi)0 (q(1)(2) = 0, q(2)(2) = Q(2)) and study its Q(2) dependence. In contrast to pQCD, we make no assumptions about the shape of the pion distribution amplitude phi(pi)(x). Our results agree with the Brodsky-Lepage proposal that the Q(2) dependence of this form factor is given by an interpolation between its Q(2) = 0 value fixed by the axial anomaly and 1/Q(2) pQCD behaviour for large Q(2), provided that one interpolates to a value close to that dictated by the asymptotic form phi(pi)(as)(x) = 6f(pi)x(1 - x) of the pion distribution amplitude. We interpret this as evidence that phi(pi)(x) is rather close to the asymptotic form.