Yes, a cup of distilled water will freeze if left in the refrigerator overnight. Distilled water is essentially pure water, free from impurities and minerals, which means it has a freezing point of 0°C (32°F) at sea level under standard atmospheric pressure.
When you place a cup of distilled water in the refrigerator, which is typically set to temperatures below 4°C (40°F), the heat from the water will be transferred to the surrounding environment, causing the water temperature to drop. As the temperature of the water decreases, it will eventually reach the freezing point, and the water molecules will start forming ice crystals, causing the water to freeze.
Keep in mind that factors like the initial temperature of the water, the refrigerator's exact temperature, and other conditions can affect the time it takes for the water to freeze, but overnight should be sufficient for it to solidify into ice.