Solar panels depend on direct sunlight in order to produce electricity. Generally, solar panels do not charge in the moonlight. Raw sunlight contains a number of energized particles, including the all-important photon. When photons from the sun strike one side of an array, they essentially cause electrons to break off from one panel, cross a thin membrane, and attach themselves to another panel. The crossing of the freed electrons is what generates a usable electrical current.
If there are no photons striking the panels, the electrons remain in place and no electricity is generated. This is why dark clouds or nightfall are so problematic when generating solar power on a commercially viable scale. When the sunlight disappears, so does the electricity. The electricity produced during daylight hours is not lost forever, however. The excess electricity is stored in large batteries and can provide power during overnight hours.
The main reason standard solar panels cannot charge in the moonlight is the nature of the moon's light. Unlike the sun, the moon does not generate its own light energy. What people see on Earth is the sun's light energy reflecting off the moon's surface. A solar panel array placed on the moon would generate electricity during Earth's nighttime hours because it is receiving direct sunlight containing photons. The reflected light seen from Earth does not contain a significant number of photons, so in most cases, moonlight will not cause the panels to generate electricity.
This is not to say that the power of the stars could not be used to generate electricity on Earth. A material sensitive to stellar energy, visible or invisible, could be used to create "stellar panels," which could supplement solar cells by generating electricity at night or on cloudy days. The current limitations of such an alternative energy source are financial and technological in nature. A material capable of converting stellar energy into electricity has yet to be perfected, and the initial cost of building a usable array would be prohibitive.
There are reports about a proprietary material developed by Russian scientists that can convert stellar energy into electricity 24 hours a day. This "heteroelectric" material is said to be less expensive to produce than standard solar cells, and has an efficiency rating of 90%, compared to the 10-12% efficiency rating of silicon-based solar panels currently in use. So even though most solar panels in use today are not able to use moonlight or stellar energy for electricity, this does not mean that it will not become a reality in the near future.
In conclusion, solar panel installation is a reliable and renewable energy source that relies on direct sunlight to produce electricity. While standard solar panels are not able to generate electricity in the moonlight, there is potential for the development of materials that could allow for the use of stellar energy to supplement solar cells.