The atmospheric boundary layer (ABL) undergoes substantial changes in its structure and dynamics in the course of a day due to the transient nature of forcing factors such as the surface fluxes of heat and momentum. The non- stationary nature of the mean wind and turbulence in the ABL, associated with the diurnal cycle, can in turn affect the structure of wind turbine wakes and their effects on power losses within wind farms. In this study, large-eddy simulation (LES) is used to study the evolution of the turbine wakes and their effects on power losses inside an idealized finite-size wind farm in the course of two full diurnal cycles. In the LES, turbulent subgrid-scale stresses are modeled using tuning-free Lagrangian scale-dependent dynamic models, while the turbine-induced forces are parameterized using a dynamic actuator disk model with rotation. To minimize the effects of the initial conditions on the results, our analysis is focused on the second diurnal cycle. The simulation results show a strong effect of atmospheric stability on the wind farm wakes and associated power losses. During the night, the relatively low turbulence intensity of the ambient ABL flow results in a relatively slow rate of entrainment of ambient flow into the wake and, consequently, a slow wake recovery. In contrast, during the day the positive buoyancy flux and associated turbulence production lead to a relatively high turbulence level in the background ABL flow, which enhances turbulent mixing and wake recovery. As a result, the averaged power deficit in the wind farm is found to increase with increasing thermal stability. In particular for that day, it increased from 27% under the most convective condition to about 61% under the most stable condition.