The Elemental vanishes in both cases
In the first case, the elemental is part of an active spell effect, so dispelling it causes the elemental to vanish. This is pretty cut-and-dry.
Less so for the second case.
Is the Disappearance of the Elemental a Spell Effect?
Normally, spells end when Concentration ends. For the vast majority of spells in 5th edition D&D, this is true, and does not need adjudicating, but for the case where the Elemental has broken free, we need to decide whether the spell has ended or not.
The hint that, to me, says the spell continues after concentration is broken is in the mechanism by which the elemental vanishes:
If your concentration is broken, the elemental doesn't disappear. Instead, you lose control of the elemental, it becomes hostile and might attack. It can't be dismissed by you, and disappears 1 hour after you summoned it.
Emphasis mine
The spell's description doesn't specify what kind of mechanism is being used to cause the Elemental to vanish. It only says that, as part of said description for the spell's effect, the Elemental vanishes. Therefore, the effect that causes the Elemental to vanish is part of the spell's effect, and dispellable.
Counterpoint: what if it's not a spell effect?
In order for this effect to not be dispellable, the effect would need to be provably a non-spell magical effect. There's a couple of ways this could be true.
The description for Conjure Elemental could contain a passage like this:
If Conjure Elemental's final effect were a non-spell effect:
"and 1 hour after you summoned it, the plane from which the elemental came from pulls the elemental back, causing it to disappear"
But the spell contains no such language.
Alternatively, the vanishing of the elemental would be a non-spell effect if it were an innate property of the elemental. But there are no Elemental creatures in 5e that have any Plane-shifting ability, or a "time limit" that causes them to return to their plane of origin.
The only other possibility is that the Inner Planes (where most elementals come from) would need to describe such a phenomenon that "pulls" rogue Elementals back to where they came from. But at least in the Player's Handbook, there's no such description.
Conclusion
Because the vanishing of the Elemental is
- Described as part of the effects of a spell, and
- Not explicitly described as being the effect of some other natural phenomena (magical or otherwise),
We therefore conclude that the vanishing of the elemental is a spell effect, and therefore dispellable. And because the spell specifically says the elemental vanishes when the spell ends, the elemental must vanish when the spell is dispelled.