Plan sunset viewing while camping.
Sunset is not the deadline — the end of civil twilight is, and how long that lasts depends strongly on latitude. Near the equator the sun drops almost vertically and usable light is gone about 22 minutes after sunset. At mid latitudes you get roughly 33 minutes, and at high latitudes in summer twilight can stretch beyond 48 minutes or never fully end. Working backwards from full darkness through your return hike and any remaining camp setup gives the real time you must leave the viewpoint. The common mistake is planning to sunset itself and then walking back to an unpitched tent in the dark.
Darkness time
Dark at = sunset + civil twilight
Latest departure
Leave by = dark at - return hike - remaining setup time
Because it depends on the angle at which the sun crosses the horizon. Near the equator it descends almost vertically and passes quickly through the twilight band. At high latitudes it skims down at a shallow angle, taking far longer to reach the same depth below the horizon.
Before, essentially always. Pitching a tent, inflating pads and sorting a sleep system by headtorch is slow, cold and error-prone. Set up first, then walk out to the viewpoint — you return to a finished camp and can afford to stay for the full colour after sunset.