Weather has an important influence on how a baseball travels when it is hit. Air pressure, wind, temperature and humidity are important to note.
Air pressure: Air pressure depends on the elevation of a region and the current weather. Air pressure is usually the most important factor in determining how far a baseball will travel in the air when hit, all else being equal. At higher elevations, air has a lower density. When the air density is lower, baseballs can travel further. Air rubbing against a baseball produces a frictional force. The lower the air density, the smaller this frictional force becomes. Air density also changes depending on whether high pressure or low pressure weather is influencing the region.
Wind: Wind either amplifies or reduces the amount of friction the baseball experiences during flight. Air flowing toward the baseball in flight acts as a force to slow the forward motion. This slows the ball down and reduces its flight path. Wind flowing with the baseball helps it fly longer distances.
Temperature: When air warms, it expands. This warming and expansion lowers the density of the air. This produces longer flight distances, all else being basically equal.
Humidity: At the same temperature, air with a higher dewpoint will be less dense. Click here for an explanation of why this is. At a higher humidity, baseballs will travel a little further, all else being equal.
Optimum for long baseball hits: high elevation, wind blowing out, warm and humid air mass
Minimization for long baseball hits: low elevation, wind blowing in, cold and dry air mass
1. There is no air on the moon and gravity is much smaller than on earth. Thus, a hit baseball will travel very very far on the moon as compared to earth.
2. Other factors effecting baseball flight are the spin imparted on the ball, force which ball is hit, and ball manufacturing.