Recently, wind energy penetration in power grids has increased in comparison with other renewable energy sources. With development of wind turbine manufacturing technologies, wind energy prices have become comparable with those of conventional energy sources. The stochastic and variable nature of wind speed causes the output power and terminal voltages of wind farms to become fluctuating. These fluctuations not only decrease the network power quality, but also cause some problems in wind farm output power planning. By using Energy Storage System (ESS) in a wind farm, the output of the wind farm can be controlled for improving the power quality and also having more economic utilization. In this paper, using Particle Swarm Optimization (PSO) algorithm, the capacity of ESS, the hourly output power of ESS and the wind farm output planning are determined. Consequently, more economic utilization of the wind farm can be achieved with respect to the output power quality. In this research, the total income from energy sales in a one year period has been obtained for three cases: without ESS, with a single ESS and with four separate smaller ESSs.