If you're heading from St. Petersburg to Tallinn, the most convenient way by far is to take the train.
This particular train service started in July 2015. It originates in Moscow, departing from St. Petersburg's Moskovski station daily at 6:25 am, making 5 stops before arriving in Tallinn at 1:43 pm. The border crossing takes some time - 40 minutes on the Russian side, 45 minutes on the Estonian side - but is relaxed and convenient. Immigration and customs officers come to you while you lounge on the train. The timetable can be found here: http://www.gorail.ee/en/timetable/
While 7 hours and 18 minutes may seem long, the alternatives are just as bad, but can include the need to transfer. For example, taking the high-speed train from St. Petersburg to Helsinki, transferring from the train station to the Helsinki-Tallinn ferry, then actually taking the ferry can take longer and be very strenuous if you're bogged down with lots of luggage. A workable alternative is taking the bus, which I've heard is pretty good, but leaves late at night with the dreaded long stop at the border.
There are 3 classes of train service, 3rd class (essentially a seat), 2nd class sleeper cabin with 4 births (2 lower and 2 upper), and 1st class sleeper cabin with 2 lower births. We were 3 persons, my wife, mother and me, with a massive amount of luggage, and chose 2 x 1st class sleeper cabins. Yes, the cost was a bit higher as we had to pay for 4 spots, us being 3 travelers, but this allowed us to properly store all our luggage while comfortably settling in for the long 7 hour train ride. Note: there are no washrooms in the cabins, just one shared on each train carriage.
The ride included meals and unlimited hot water, however you had to pay for coffee, a nominal approx. 86 rubles (I can’t recall exactly). Weirdly, they have a strange calculations on how many meals you get: 1 meal for 2 persons, 3 meals for 4 persons. Not the best food though - we had our hotel prepare us a breakfast box which came in handy.
We thoroughly enjoyed the ride. It was comfortable, and the staff was great. Border crossing was an breeze, and we arrived rested for our stay in Tallinn. If you’re going from St Petersburg to Tallinn, or vice-versa, this is a great way to make that journey.