The boat tickets are cheaper to Tallinn, and the journey takes only 1.5hrs, when if you go to Sweden it's one night there and one night back. Also the tickets are semi-expensive, because you get your own cabin. But if you are 4 ppl, it is not that bad. But also there are often available discount tickets, like 50€/4ppl's cabin, so if you have friends in Finland, you can ask if they have spare ones. Usually someone has one. Sometimes I have had three and haven't used them, because...
I hate going on these boats. They are filled with drunken ice hockey players, elderly people and drunk teenagers. Also often news write about rape happened on board or that someone has "dropped" to the sea. And it's not suicide it's just because people go on these boats to get absolutely hammered.
Also you have only around 8hrs to be in Stockholm, so what can one do in 8hrs? Not enough! But if you want to have a fast visit there and just see how Stockholm is, this is good.
In Tallinn you will have more time, even 12hrs is possible (if you are planning a day trip, you can also stay over night there). There's one thing: Estonians don't like that much Finnish turists, because Finnish people go to Tallinn always very drunk. They drink that 1.5hrs on boat, then they arrive in Tallinn (drunk), then they behave like animals (pee around, men disturb the Estonian girls) and leave the city.
But as you are not from Finland, you'll be ok. But if you see some people behaving disrespectful there, it is probably a Finn.
Boats depart from central Helsinki and Ruoholahti. The ones that go to Sweden are Silja Line and Viking Line. The ones that go to Tallinn are e.g. Tallink.
This is not funny, it's sad. Sorry Estonians!