ANH - several weeks at least (death star probably cannot use light-speed travel)
ESB - several weeks as well (millennium falcon had broken hyperdrive)
ROTJ - two weeks
I’m pretty sure it’s always been canon that the DS has light-speed capabilities. It has at least always been part of the EUs.
As for non/pre-EU canon, although SW takes huge liberties with its “science” I can’t imagine how many years/decades/etc it would take the DS to reach Yavin at sub-light speed. (Keep in mind that Hoth and Bespin are relatively close.)