Weather plays an important influence on how a baseball travels when it's hit. Air pressure, wind, temperature and humidity are all important factors:
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. At a higher humidity, baseballs will travel a little further, all else being equal.
Optimum Weather 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.