Over-the-air computation (AirComp) is considered as a communication-efficient solution for data aggregation and distributed learning by exploiting the superposition properties of wireless multi-access channels. However, AirComp is significantly affected by the uneven signal attenuation experienced by different wireless devices. Recently, Cell-free Massive MIMO (mMIMO) has emerged as a promising technology to provide uniform coverage and high rates by joint coherent transmission. In this paper, we investigate AirComp in Cell-free mMIMO systems, taking into account spatially correlated fading and channel estimation errors. In particular, we propose optimal designs of transmit coefficients and receive combing at different levels of cooperation among access points. Numerical results demonstrate that Cell-free mMIMO using fully centralized processing significantly outperforms conventional Cellular mMIMO with regard to the mean squared error (MSE). Moreover, we show that Cell-free mMIMO using local processing and large-scale fading decoding can achieve a lower MSE than Cellular mMIMO when the wireless devices have limited power budgets.