When summer rolls around in Phoenix I never leave electronics (or milk or lipstick) in the car. What do I mean by summer? Here in the Sonoran Desert, temperatures can reach triple digits as early as April, and may still occur through September and even October.
Extreme temperatures during summer in the desert require that you take special precautions with your smartphone or tablet. During our milder months, I often travel around town with my tablet in a case under the seat in my car. I have also been known to leave my phone in a compartment of my vehicle (never in plain sight!) as I flit from event to attraction to appointment, since I carry a camera, keys and a few other essentials, but not in a purse.
I have an iPhone and an iPad. Apple Inc. advises that operating those devices at temperatures above 95°F may result in shortened battery life or unexpected behaviors. Honestly, I am never outside long enough with my phone to have it reach 95°F, because I am in and out of air conditioning. I don't work outside, and I don't lie around on the beach with it (we don't have a beach!) nor do I leave it on the hot concrete by the pool.
If you aren't operating the phone or tablet (it is turned off), storing it in a place where the temperature gets to 113°F or higher may make certain features stop working, or the device may stop working altogether. It might stop charging, the camera flash may stop working, or the entire display might go dim or black. You should never leave your smartphone or tablet in your vehicle during our hot summers. Even if it is not left in direct sunlight (never do that either), the temperature in the car becomes significantly higher than the temperature outside.
How much higher? The temperature inside a closed vehicle that has been sitting in our hot sun can reach over 200°F in a very short time. If you've ever parked outside when it's 110°F and gone into a theater to watch a matinee movie in cool comfort, you'll know how the car interior feels when you return and first get inside. It's what I describe as: take-your-breath-away hot. That's no place for your smartphone.
Bottom line, for five or six months of the year I would not leave your smartphone or tablet in a vehicle parked outside in the sun on a hot day in the Phoenix desert. Likewise, you shouldn't leave it in direct sunlight. If the device does overheat, it will try to protect the components by turning features or the device itself off until it cools down.
Apple advises that if your iPhone or iPad exhibits signs of overheating, turn off the device, move it to a cooler place (not an ice bath, just an air-conditioned location), and allow it to cool down before turning it back on. Ten minutes should usually do the trick. Can your iPhone be permanently damaged? It's possible, but it is likely that the battery will be most affected by prolonged exposure to hot temperatures. If you need help, with your Apple products, an employee at a local Apple Store can assist.
You say you have a smartphone or tablet that's not an Apple product? All manufacturers have a suggested operating temperature range, so you can check your brand's specific recommendations. Some of those optimum operating temperatures may be different than the iPhone or iPad.