If Tor is able to hide the IP address of the machine and make us anonymous, then does it prevent the ISP from tracking us?
You cannot hide how much data you are sending and when you are online. But, Tor encrypts data and sends it through proxies before it reaches the target server, so that hides the contents of the communication and to which website or server you are talking. You can also try to hide that you are using Tor, but this is difficult and a determined ISP will be able to determine that you are using Tor.
The first proxy will decrypt the outer layer of encryption and send it on to a middle proxy. The middle proxy does the same and sends it onto the final proxy. The final proxy finally decrypts your original request, so be aware that they can see the contents of what you are sending and to which website or server it is being sent. But they don't know that it came from you.
Note that, while the final proxy can see the contents, if you use "https" then the contents are still encrypted. I would not do internet banking over Tor unless you know very well what you should be checking (IDN homoglyph attacks, the certificate, perhaps other things), but generally speaking: https encrypts your communication. They can still see which website you are talking to, though, since contents encryption does not hide routing information (the page request, form data, etc. still needs to get to the right website).
See also the top hit on duckduckgo for "tor isp tracking": Does my ISP know what sites I have visited if I am using Tor?