To better track the planned output (forecast output), energy storage systems (ESS) are used by wind farms to compensate the forecast error of wind power and reduce the uncertainty of wind power output. When the error compensation degree is the same, the compensation interval is not unique, different compensation intervals need different ESS sizing. This paper focused on finding the optimal compensation interval not only satisfied the error compensation degree but also obtained the max profit of the wind farm. First, a mathematical model was proposed as well as a corresponding optimization method aiming at maximizing the profit of the wind farm. Second, the effect of the influencing factors (compensation degree, electricity price, ESS cost, and wind penalty cost) on the optimal result was fully analyzed and deeply discussed. Through the analysis, the complex relationship between the factors and the optimal results was found. Finally, the comparison between the proposed and traditional method was given, and the simulation results showed that the proposed method can provide a powerful decision-making basis for ESS planning in current and future market.