At ARN, stay airside—explore food and shops as transport into the city won’t be worth the time.
Stay at the airport for a layover under 6 hours. Arlanda has good lounges if you have access, and the transit time to the city eats nearly 2 hours round trip on the express train. The airport terminal is clean and has decent food options at gate.
Take the Arlanda Express to Stockholm Central (18 minutes, SEK 299). Walk to Gamla Stan in 10 minutes and spend an hour in the medieval streets. Head to Sodermalm for lunch: Hermans vegetarian restaurant at Fjallgatan 23B has views over the water and a buffet for around SEK 185. Leave Gamla Stan by hour 3.5 to make the train back comfortably.
With 10 hours, add the Vasa Museum on Djurgarden Island (SEK 190, about 90 minutes). The ferry from Gamla Stan to Djurgarden runs every 20 minutes. You can also walk the path from Sodermalm over the bridges, which takes 20 minutes and gives you water views the whole way.