"The sun runs to a resting place/stopping point/stopping time (mustaqirr) of its own. That is the decree of the Mighty, the Knowing." (36:38)
Clasically, the sun's "resting place" has been taken to mean: (a) the sun disappearing after sunset (just as a human being goes to their dwelling place at night before rising in the morning), (b) the final destiny of the sun on the Day of Judgment, or (c) the solstice, in a reference to the sun following its winter and summer orbits until the solstice.
Today, some Muslims interpret it as referring to (d) the astronomical end of the sun/the solar system.
Personally, I tend to see this as a poetic or celebratory expression of the natural world, than a statement intended to inform people of a scientific fact (even if the Qur'an is consistent with facts of reality).
In any case, options (a), (c), and (d) match scientific understanding (obviously, from the perspective of earth, the sun rises and sets).
Option (b) is outside the domain of science since it pertains to the end times and hereafter which no longer operate according to the natural laws presently.
(Some people seem to be of the view that it is unscientific to say that, from the perspective of an earth observer, the sun rises and sets. Perhaps people do not go out and watch sunrises as often as they used to; however, I would challenge them to explain why it is unscientific to discuss sunrise and sunset, when this has such a gigantic impact on things such as the weather and ecology, not to mention basics such as timekeeping. So it is scientifically fine to discuss the sun from the perspective of an earth observer, or from the perspective of right outside the solar system, or from an intergalactic perspective; they are all just viewpoints.)
As for "running", this matches the idea that the sun has a motion in the galaxy/universe and is not fixed in one spot, although it also matches the idea that the sun moves along the sky from the perspective of an earth-based observer. So either perspective is correct with respect to reality.
So the verse is open to several interpretations but they do not conflict with what is known about how the universe and natural world works. Probably the main point is to inspire reflection on the natural order.