You can buy a One-Day-Ticket for 95 SEK (about 12 USD) and get on and off the buses as often as you wish. More information on prices and sales outlets here
, on self-guided sightseeing here
The One-Day-Ticket should be valid for the journey from Nynäshamn, too - however, I'm not absolutely sure.
Have fun in Stockholm, it's a great city!