This paper examines the problem of how to design incentive-compatible mechanisms in environments in which the agents' private information evolves stochastically over time and in which decisions have to be made in each period. The environments we consider are fairly general in that the agents' types are allowed to evolve in a non-Markov way, decisions are allowed to affect the type distributions and payoffs are not restricted to be separable over time. Our first result is the characterization of a dynamic payoff formula that describes the evolution of the agents' equilibrium payoffs in an incentive-compatible mechanism. The formula summarizes all local first-order conditions taking into account how current information affects the dynamics of expected payoffs. The formula generalizes the familiar envelope condition from static mechanism design: the key difference is that a variation in the current types now impacts payoffs in all subsequent periods both directly and through the effect on the distributions of future types. First, we identify assumptions on the primitive environment that guarantee that our dynamic payoff formula is a necessary condition for incentive compatibility. Next, we specialize this formula to quasi-linear environments and show how it permits one to establish a dynamic "revenue-equivalence" result and to construct a formula for dynamic virtual surplus which is instrumental for the design of optimal mechanisms. We then turn to the characterization of sufficient conditions for incentive compatibility. Lastly, we show how our results can be put to work in a variety of applications that include the design of profit-maximizing dynamic auctions with AR(k) values and the provision of experience goods.