The orange line signifies the end/duration of the current animation.
It currently can't be adjusted by dragging the line itself; It's not a cursor handle.
The saved animation duration is determined by the rightmost key of the animation, even if that key is hidden.
Keys can be hidden in the dopesheet for a number of reasons:
(1) You have Dopesheet filters on (according to your screenshot, you don't)
(2) You disabled visibility of dopesheet items that have keys, like bones and slots.
(3) You have another item/other items selected, which causes the dopesheet to focus and show only the keys of those items.
