Many of the biological, social and man-made networks around us are inherently dynamic, with their links switching on and off over time. The evolution of these networks is often observed to be non-Markovian, and the dynamics of their links are often correlated. Hence, to accurately model these networks, predict their evolution, and understand how information and other relevant quantities propagate over them, the inclusion of both memory and dynamical dependencies between links is key. In this article we introduce a general class of models of temporal networks based on discrete autoregressive processes for link dynamics. As a concrete and useful case study, we then concentrate on a specific model within this class, which allows to generate temporal networks with a specified underlying structural backbone, and with precise control over the dynamical dependencies between links and the strength and length of their memories. In this network model the presence of each link is influenced not only by its past activity, but also by the past activities of other links, as specified by a coupling matrix, which directly controls the causal relations, and hence the correlations, among links. We propose a maximum likelihood method for estimating the model's parameters from data, showing how the model allows a more realistic description of real-world temporal networks and also to predict their evolution. Due to the flexibility of maximum likelihood inference, we illustrate how to deal with heterogeneity and time-varying patterns, possibly including also nonstationary network dynamics. We then use our network model to investigate the role that, both the features of memory and the type of correlations in the dynamics of links have on the properties of processes occurring over a temporal network. Namely, we study the speed of a spreading process, as measured by the time it takes for diffusion to reach equilibrium. Through both numerical simulations and analytical results, we are able to separate the roles of autocorrelations and neighborhood correlations in link dynamics, showing that not only is the speed of diffusion nonmonotonically dependent on the memory length, but also that correlations among neighboring links help to speed up the spreading process, while autocorrelations slow it back down. Our results have implications in the study of opinion formation, the modeling of social networks, and the spreading of epidemics through mobile populations.