Global warming and excessive use of depletable energy resources are considered as some of the most serious problems that need to be solved. As a response, renewable energy sources (RES) have been gaining an increasing importance in recent years. The electrical power generated from RES tends to be fluctuating due to intermittency of wind speed and solar radiation which may result in frequency and voltage deviations in the grid as well as loss of the capacity to serve the load. Distributed generation of windphotovoltaic hybrid systems connected to energy storage (ES) is proposed to overcome the variability of RES. However, the high cost of the equipment for such systems is also a challenge. In this dissertation, planning of a hybrid wind-photovoltaic energy system combined with ES connected to a distribution system is described. The planning procedure is done in two different configurations. In the first one, the objective is to find optimal ES size for a wind farm. The objective function measures the economic benefit gained from selling of the dispatched power to the grid against the cost of ES. The result of the optimization gives the optimal size of ES. A probability distribution function (pdf) is created to represent the optimal size of ES for the planning horizon and then a case study for one year is conducted to illustrate the proposed method. For the second configuration, optimization techniques which use linear programming, two stage stochastic programming and scenario aggregation are deployed in order to find the optimal plan for the hybrid energy system. The proposed procedure uses historical wind iii speed, solar radiation, energy market price, and load data to determine the system design. The objective function measures the total annual cost of the proposed system.