Does using Tor guarantee anonymity?
No, using Tor WILL NOT always guarantee full anonymity. While Tor is hands-down the closest thing that we can get to complete privacy of our internet browsing, it does have its flaws. Let me explain.
Why is Tor not 100% anonymous?
While we will not get into much detail on how Tor works, here is an article that covers it really well.
So when it comes to browsing anonymously on Tor, there is only one big issue, and it's that Tor is not used for casual browsing. Yes, people do say that Tor is used by people who feel like they are being stalked or journalists who want to hide their tracks, but there are currently 36 million Tor users and trust me, a good number of those users are not people who you would want to be your neighbors.
While Tor is exceptionally good at hiding your IP address, it does not mean that people who commit a crime through Tor are not criminals. Using Tor is not illegal, but that doesn't mean that the law will not TRY to knock on your doors if you do some illegal stuff through it. In other words, a hidden IP doesn't make a criminal not wanted by the law enforcement.
How should you protect yourself while using Tor?
Just don't do anything stupid. As simple as that sounds it's the best way to protect your identity. If you're just browsing it for fun without doing anything stupid, the law will not be interested in you. The only threat left after the law are hackers and the best way to protect yourself from them is to use caution. Don't download anything from Tor, don't put your credentials into any website while on Tor, don't put your address, etc... You get the point. Have fun and remember, don't do anything stupid.