Mike gives the perfect engineering explanation. He's right.

The gut feeling though is.....

If it's high stress area, lots of pull or push, use 1 every 1.5" or so. Just holding a panel on (like firewall?) use every 3" or so. If you like the look of rivets/screws, use more. I used one every 2" on my firewall and, while it looked great empty, once everything was in, it's too crowded looking. Shoulda used 3".

Places like the side behind door holding the body on, those are mostly for location, so I used 4 across there.

Just make sure you use enouhh seam sealer for the amount of fasteners. You don't want any weird vibration rattles.