Demand response (DR) programs are implemented to encourage consumers to reduce their electricity demand when needed, e.g., at peak-load hours, by adjusting their controllable load. In this paper, our focus is on controllable load types that are associated with dynamic systems and can be modeled using differential equations. Examples of such load types include heating, ventilation, and air conditioning; water heating; and refrigeration. In this regard, we propose a new DR model based on a two-level differential game framework. At the beginning of each DR interval, the price is decided by the upper level (aggregator, utility, or market) given the total demand of users in the lower level. At the lower level, for each player (residential or commercial buildings that are equipped with automated load control systems and local renewable generators), given the price from the upper level, the electricity usage of air conditioning unit, and the battery storage charging/discharging schedules, are controlled in order to minimize the user's total electricity cost. The optimal user strategies are derived using the stochastic Hamilton-Jacobi-Bellman equations. We also show that the proposed game can converge to a feedback Nash equilibrium. Based on the effect of real-time pricing on users' daily demand profile, the simulation results demonstrate the properties of the proposed game and show how we can optimize consumers' electricity cost in the presence of time-varying prices.