Marijuana can survive between the temperatures of 60°F (16°C) and 92°F (33°C) but those are not ideal temperatures, those are the extremes that the plant can generally survive without dying. Ideal temperature control allows you to grow larger and higher quality marijuana with denser buds. In fact, once the basic nutrient and light needs of the plant are met, temperature control has the greatest impact on flower density of any other element.
The ideal range for marijuana is 75–83°F (24–29°C). Flower density will be determined not so much by the temperature you grow at but by the range of temperature. It is better to have plants that sit at 85°F (29°C) during the day and 83°F (28°C) at night, than 83°F (28°C) during the day and then 75°F (24°C) at night.
Getting those temperatures and temperature ranges can be quite a challenge but there are tricks to help. One simple trick is to have the hot lights run at night and have the dark period occur during the daytime hours. A small space heater or heating pad can be used to raise temperatures if needed. And of course airflow and air conditioning are a great way to remove heat and hot air from your grow environment. If your grow is closed for CO2 exchange then a dehumidifier is a great way to reduce temperatures.