The gap between solar panel rows should be around five to six inches, but it is also recommended that you leave one to three feet of space between every second or third row. This is because maintenance workers need enough room to get on the roof and make repairs whenever necessary.
The American Society of Civil Engineers (ASCE) provides guidelines for the structural design of solar panel installations through their publication, ASCE.