What are the best places to gain the most altitude in a glider?
First, you need practice. Take every opportunity to expand your experience. Theory helps but will never compensate for missing practical experience.
But then you also need to know how thermals form. Let's start low, close to the ground. Two things are important: A chance for the sun to heat the ground (and, consequently, the air above), and an opportunity for that heated air to ascend. Dry ground will heat up better than moist ground, and dark earth better than light sand. If the ground is completely featureless, the air will stay on the ground. So you need to find the trigger which determines where air starts to rise up. Once it does this, more air will be sucked in from the side, and will follow up. That is how a thermal starts.
And that summer gust, which is the horizontal motion of more warm air flowing towards the point where a thermal starts, should indicate to you that now you have a chance to stay up, so now you need to get into your glider. Early in the day the thermals will not go high, so don't be impatient. On the positive side, there are many thermals and a good chance of finding the next one quickly.
Once in the air, look for triggers. One of the easiest is a windward edge of a forest. Warm air is driven towards the forest by the prevailing wind, and the trees will push the air up, kickstarting its ascent. Fly along and a bit leeward of the ridge and you can't miss the thermals there. But even a closed forest is a good source of thermals: The dark trees heat up well and the air between the trees heats up quickly. A small elevation is normally enough to start a thermal. In the mountains, a windward ridge is also an obvious trigger, and it is advisable not to drop below the height of the lowest ridge, as you suddenly might find yourself unable to find any more thermals.
Once higher up the ground features become more and more unimportant. For one, wind is shifting everything sideways, but also now the large-scale vorticity which forms the clouds dominates where the thermals form. Think of cumulus clouds as giant thermal vacuum cleaners which collect the rising air from all around. But not any cumulus cloud: Most promising are the ones which grow, have sharply defined edges and a dark bottom which is bulged upwards towards the center. Flee from the fuzzy ones with a round bottom: They have lost their pulling power and are about to disappear.
Why the bulged-in bottom? THAT is where the heated air goes up and pushes the bottom of the cloud up. But what goes up must come down: In the vicinity of the best clouds you will also find the worst downdrafts. Fly through those quickly and pull up as soon as the downdraft stops.
If you fly cross-country, the most important knowledge is in which direction the wind is blowing. If the wind is strong enough (more than a soft breeze), thermals will line up in wind direction, so you can just leave one straight into the wind (or with the wind) and be sure to hit the next one shortly. This works particularly well if there are no clouds to follow (blue thermals). Just remember where exactly that one-before-last thermal was and fly off in exactly the opposite direction. When that brings you too far off the planned course, cross the valley of downdrafts orthogonal to the wind direction until you arrive in the next lineup of thermals.
Now to how to circle properly. A glider will fly at its minimum sink speed when induced drag is three quarters of total drag - given the high aspect ratio of gliders this means at a really high lift coefficient. Close to stall. Therefore, it is most important to learn how the glider warns you that you are about to stall. Also, some gliders will happily let you fly in a stalled condition (the Discus is a prime example) with really poor sink speed but without loss of control. Go up to maybe 1000 m and then stall the glider slowly. Learn how that feels. Then continue with circles. Stall the glider again. At some point you will feel how the stick forces lighten (that is when flow separation starts on the ailerons!) and you will learn to fly just a bit faster than that. Similarly, the stalled Discus has really soft and mushy controls - fly faster until the controls feel stiff again!
Since circling with more than 45° of bank is rather stressful, fly between 30° and 45° of bank angle. You need to catch the core of the thermal, where the climb speed is highest, and banking more is worth the tradeoff in many cases. Tighten the circle when the climb speed decreases and widen it when speed increases - that helps you to center your circling with the center of the thermal. Learn the hysteresis of your instruments - maybe you need to phase-shift your reaction so you really land in the center of the thermal. For me, I found it easier to remember where the climb speed was best and to shift my next circle in that direction when flying two-seaters - they are too sluggish to do that on-the-fly optimization you can do with the more nimble single seaters.