With a gas grill the lid down will hold in heat, brining up temperatures quickly. Every time you open the lid you vent all the built up heat from the grill and slow the cooking process. Since grilling is best done fast and hot it is usually best to leave the lid down as much as possible on your gas grill. Of course there are always exceptions. Foods that just need to be warmed or that are thin and will cook very fast anyway can be done with the lid up. A hamburger really won't notice the difference since it is cooked by direct heat in only a few minutes. However a large roast or a whole chicken, which take much longer to cook, will need the added heat by having the lid down. Indirect cooking always requires the lid down. For me personally I always grill with the lid down. But keep a close eye on it. Flare-ups will happen much faster with the lid down.
On a charcoal grill putting the lid down (or on) will control the flow of air. Depending on the position of the vents, lid down may give you a low temperature or a high temperature.

