One of the main questions regarding complex systems at large scales concerns the effective interactions and driving forces that emerge from the detailed microscopic properties. Coarse-grained models aim to describe complex systems in terms of coarse-scale equations with a reduced number of degrees of freedom. Recent developments in machine-learning algorithms have significantly empowered the discovery process of governing equations directly from data. However, it remains difficult to discover partial differential equations (PDEs) with high-order derivatives. In this paper, we present data-driven architectures based on a multilayer perceptron, a convolutional neural network (CNN), and a combination of a CNN and long short-term memory structures for discovering the nonlinear equations of motion for phase-field models with nonconserved and conserved order parameters. The well-known Allen-Cahn, Cahn-Hilliard, and phase-field crystal models were used as test cases. Two conceptually different types of implementations were used. (a) guided by physical intuition (such as the local dependence of the derivatives) and (b) in the absence of any physical assumptions (black-box model). We show that not only can we effectively learn the time derivatives of the field in both scenarios, but we can also use the data-driven PDEs to propagate the field in time and achieve results in good agreement with the original PDEs.