In this paper, a novel joint planning framework is proposed to coordinate the investment and operation of renewable energy sources and energy storage systems (ESS) in energy and ancillary services markets. Based on this framework, coordinated planning and operation model under centralized and deregulated market mechanism is studied, and multiple factors such as siting and sizing of wind turbine and ESS, the efficiency of ESS, transmission lines constraints are considered. For the centralized market mechanism, the coordinated model aiming at maximizing social welfare is established, which is a tractable single-level optimization problem. For the deregulated market mechanism, the coordinated model aiming at maximizing investment profits is established, which is an intractable bi-level optimization problem as the locational marginal price in the objective function. The bi-level optimization problem is reformulated into a mathematical problem with equilibrium constraints by Karush-Kuhn-Tucker conditions. The big-M method and strong dual theory are used to deal with the nonlinearity in constraints and objective functions, and the problem is transformed into a mixed-integer linear programming, which can be solved by commercial software. Furthermore, the impact of production tax credit and investment tax credit financial incentive policies on investment behavior has been studied, and the evaluation indexes of electrical information and economy have been established. The proposed approach has been implemented on the IEEE 6-bus and the IEEE 30-bus test systems, and results justify the efficiency of the model proposed.