Bounded orbits in homogeneous dynamics and number theory