Heat pumps in combination with a photovoltaic system are a very promising option for the transformation of the energy system. By using such a system for coupling the electricity and heat sectors, buildings can be heated sustainably and with low greenhouse gas emissions. This paper reveals a method for dimensioning a suitable system of heat pump and photovoltaics (PV) for residential buildings in order to achieve a high level of (photovoltaic) PV self-consumption. This is accomplished by utilizing a thermal energy storage (TES) for shifting the operation of the heat pump to times of high PV power production by an intelligent control algorithm, which yields a high portion of PV power directly utilized by the heat pump. In order to cover the existing set of building infrastructure, 4 reference buildings with different years of construction are introduced for both single- and multi-family residential buildings. By this means, older buildings with radiator heating as well as new buildings with floor heating systems are included. The simulations for evaluating the performance of a heat pump/PV system controlled by the novel algorithm for each type of building were carried out in MATLAB-Simulink® 2017a. The results show that 25.3% up to 41.0% of the buildings’ electricity consumption including the heat pump can be covered directly from the PV-installation per year. Evidently, the characteristics of the heating system significantly influence the results: new buildings with floor heating and low supply temperatures yield a higher level of PV self-consumption due to a higher efficiency of the heat pump compared to buildings with radiator heating and higher supply temperatures. In addition, the effect of adding a battery to the system was studied for two building types. It will be shown that the degree of PV self-consumption increases in case a battery is present. However, due to the high investment costs of batteries, they do not pay off within a reasonable period.