To achieve a successful integration of fluctuating renewable power generation, the power-to-heat (P2H) conversion is seen as an efficient solution that remedies the issue of curtailments as well as reduces carbon emissions prevailing in the district heating (DH) sector. Concurrently, the need for storage is also increasing to maintain a continuous power supply. Hence, this paper presents a MILP-based model to optimize the size of thermal storage required to satisfy the annual DH demand of a community solely by P2H conversion employing renewable energy. The DH is supplied by the optimal operation of a novel 2-km deep well heat pump system (DWHP) equipped with thermal storage. To avoid computational intractability, representative time steps with varying time duration are chosen by employing hierarchical agglomerative clustering that aggregates adjacent hours chronologically. The value of demand response and the effect of interannual weather variability are also analyzed. Numerical results from a Finnish case study show that P2H conversion utilizing small thermal storage in tandem with the DWHP is able to cover the annual DH demand, thus leading to a carbon-neutral DH system and, at the same time, mitigating the curtailment of excessive wind generation. Compared with the annual DH demand, an average thermal storage size of 29.17 MWh (2.58%) and 13.99 MWh (1.24%) are required in the business-as-usual and the demand response cases, respectively.