A lot of people go up to the Doi Suthep Temple near sundown to get the panoramic view from the lookout platform. The temple closes doors at 9pm, however the last Songthaew (red bus) leaving from the temple back to Chiang Mai leaves at 7:30pm! So unless you rode up by yourself on a bike or motobike/scooter, don't stay too late!
The cost ranges from 40baht - 80baht, much cheaper than going up
The bus actually stops at a lookout point on the way down for you to get out and take photos of the night view of the city.
If you get stranded, you can try to use Grab (Thai uber) to find a car, most likely if a driver would agree to come up and take you if you give him extra money. My friend had to pay 500baht instead of the listed price.