The rapid urbanization in Northwest China highlights the mismatch of increasing energy demand and limited local energy supply. Nevertheless, the remote areas in Northwest China are abundant with rich solar energy resources and land space resource. Therefore, establishing a distributed solar energy system (DSES) is a feasible solution to the energy supply problem in remote Northwest China. Due to the strong fluctuations in the availability of solar energy, operation strategies based on fixed parameters may not ensure optimal operation of DSESs. In this study, dynamic operation strategies that allocate surplus power from photovoltaic panels according to variable ratios were developed in both grid-connected and off-grid scenarios, a joint optimization model for optimizing the design and operation of a DSES was established based on the dynamic operation strategies, and a DSES of a residential building in Shaanxi Province was used as a case study. The analysis results indicate that: (1) The dynamic operation strategy can effectively reduce the operating cost of the DSES in both the grid-connected and off-grid scenarios, and the efficiency of the proposed strategy can be further enhanced by increasing the difference between peak and valley time-of-use electricity prices in the grid-connected scenario; (2) the difference between peak and valley time-of-use electricity prices has a significant impact on the optimal capacity of the batteries in the grid-connected scenario when the dynamic operation strategy is implemented. The greater the difference between peak and valley time-of-use electricity prices, the greater the configured capacity of the batteries; (3) in terms of abandoned photovoltaic power in the off-grid scenario, the three operation strategies considered in this study can be arranged in an ascending order (i.e., strategy B, strategy A, and the dynamic operation strategy). The dynamic operation strategy achieves a reduction of 12.4% in abandoned photovoltaic power compared with strategy A and a reduction of 45.4% compared with strategy B.