Performance of a Latent Heat Thermal Energy Storage depends strongly on the spatial layout of high conductive material and phase change material. Previous design studies have explored a limited design space and have rarely taken advantage of any formal optimization approach. This paper presents a topology optimization framework of a Thermal Energy Storage system involving phase change. We solve the Stefan problem for solidification with a fixed grid finite element method based on the apparent heat capacity technique, while the topology optimization problem is formulated using a density-based method. This approach allows to identify design trends that have been rarely investigated in the past. Firstly, we explore the inherent trade-off between discharged energy and required time for complete discharge. We obtain very different designs and highly varying performances at selected Pareto points. Secondly, by comparing results obtained in two and three dimensions we observe that 3D designs allow superior performances by presenting features that are not apparent in 2D. Thirdly, we propose a formulation of the design problem that yields a nearly constant thermal power output during the entire discharge process. If the maximum discharge time is sufficiently large, the optimized design presents fins that are disconnected from the internal tube.