When the temperature is too hot or too cold the dog should be inside a cool or warm house most of the time.
It's okay to take the dog outside in freezing weather for at least 30 minutes to an hour to allow the dog to potty and run around for exercise for awhile but make sure you bring the dog back inside during the winter and never leave the dog outside during winter weather for longer than an hour especially if the temperature is freezing or below freezing.
If it's 95 F and above the dog needs to have plenty of water and be in the shade as much as possible and also bring the dog inside the house if you have air conditioning to allow the dog to cool down.
Or at least have a fan blowing on the dog to allow the dog to cool down.