The following site has world-records:
Looks like the longest glider flight is 1646 km out and return, there are others out there.
Couldn't find the one for the motor glider.
Looks like the highest absolute altitude a glider has reached is 14938m or 49790ft.
It's not just only thermals that can get you the long flight, if you've got a good ridge lift, you can follow a mountain range for a long way. Once you get hight enough you can catch the rotors (the ones that powered airplanes avoid because of turbulence) to go higher.
Bonus animus sit, ab experientia. Quod salvatum fuerit de malis usu venit judicium.