I am the queen of thermal management. It is not gas or deco that ends my dives, it is cold.
Here are my tips: First off, do not skimp on exposure protection. Whatever you buy, make sure it's good quality and it works. For wetsuits, that means adequate thickness for the water temperature, and a REALLY good fit. For dry suits, that means a reasonably good fit and good quality, purpose-made undergarments, and enough of them. Weight is the price we pay to dive warm. Add a hood if you are getting cold in what you have -- hoods can make a big difference, even in relatively warm water.
Second, practice conservation of thermal units. That means not leaving any in the parking lot, or on the boat. When I dive, I go to the site in my undergarments, with the heater in the truck on -- I'm not happy unless I'm mildly uncomfortably hot by the time we get there. I wear a hat and a heavy coat OVER my undergarments while I'm getting my gear ready, if the air is at all chilly or moving. (Do not underestimate the ability of moving air to sap warmth from your body, even if it doesn't feel particularly cold.) In the tropics, I often wear a windbreaker, even though everybody on the boat laughs at me.
I don't do dive planning or gear checks in the water -- get that all done before you get in, so you don't lose thermal units on the surface.
While diving, if you are getting cold, swim more. Hovering and being still results in getting cold much faster. I don't cover ground in a hurry, but if, for example, I'm diving with a photographer, I'll slowly kick around him while he's taking his shot, or practice back-kicking or something that keeps me at least moving.
Once you are out of the water between dives, get rid of as much wet stuff as you can. You'd think a neoprene wetsuit would be an insulator on land, too, but if it's wet and the wind is blowing across it, you will continue to get cold. Wrap up in dry, warm stuff, drink warm drinks. If you have a hood and gloves, see if there is hot water to put them in (or to put in them before you put them back on). Similarly, if you are putting on a cold wetsuit, see if there is some warm water you can pour into the suit as soon as you have it on.
Even with a dry suit, you don't want to be exposed to the wind while you are wet.
You are not really warm until you begin to sweat -- so just because you're no longer shivering or don't feel terribly cold, don't stop husbanding thermal units.
In hot weather, this has to change a bit. Get gear together and get into your exposure protection last thing. Try not to do any checks in the water, unless you simply cannot stand the heat or you are sweating profusely into a drysuit (wet undergarments don't insulate well).
If you are diving dry, address all leaks immediately. Even a damp arm can really impact how warm you stay during a dive.
And finally, if you are diving off a boat or someplace where you are planning multiple dives, consider cutting the first one or two short to avoid having to eschew the last one altogether.