This is a such a beautiful city to visit, especially if you are a history fan. The city center is not too big so you do not need more than a day to walk around and explore it more if you are fine walking around for couple hours or a bit more (depends on how fast of a walker you are).
Of course, you will easily spend much more time here if you decide to visit some of the churches, walls, museums, nice small cafes or great restaurants...
Speaking of great restaurants, unfortunately Yelp is not in Estonia, but if you are looking for a GREAT restaurant in Tallinn, I would definitely recommend a place called The farm that focuses on use of local and fresh produce. The food was simply out of this world. Moreover as a beer fan, I have to say I was stoked too! They had three local beers on tap which all of them were absolutely fantastic. The restaurant has also part with a cafe where you can find absolutely amazing deserts. I only wish I lived closer... Enjoy!