I have done the reverse--stayed in glorious Tallinn for a solid week and took the ferry to Helsinki for a day trip, early September. I used the Tallink Silja line, and recall the trip was about 2.5 hrs on a very large and well-appointed ship. The port in Tallinn is perhaps a 10 minute taxi ride to Old Town in Tallinn, possibly walkable. If you were to arrive at, say, 9-10 am and depart at 5-6 pm you could have a very enjoyable day--but I'll just warn you that Tallinn is absolutely enchanting and you will wish you had stayed a day or two. I have been there twice now and hope to return again with more time to explore other towns.
Your day should include a good wander through old town for a few hours--lost of twisty little cobblestone lanes, small shops and restaurants tucked away, and then the big town square. You might consider a walking tour if that suits your needs. The best souvenir will be something hand-knitted as Estonia is known for their knitting traditions (I am a knitter, so will say the best place for these items are the shops that specialize in Estonian handcrafts), also there's St Catherine's Passage which is full of wonderful artist shops. The view from Toompea Hill is just fabulous, stop by Alexander Nevsky cathedral, there's an excellent museum a few blocks away devoted to the occupation of Estonia and if you have time there's Kadriorg park with a palace to tour and the KUMU museum of contemporary art--take a tram there from the outskirts of old town. Another place to spend a couple of hours is the Balti Jaama Turg, a marketplace near the train station outside the old town walls--great food stalls, and entire floors devoted to antiques and one for handcrafted (good quality) items--this would be a good place to end your day and catch a taxi back to the port.