There are several factors that affect the time it takes to disappear, it's not worth it to calculate it exactly since it's different against different opponents.
My general rule of thumb is that when I'm spotted, don't panic... either move back into cover behind a solid structure or find a large enough bush and hide 20m+ behind it (you should reverse into this position so that the front of your tank is facing enemy for a better chance of bouncing their shots)
If I am spotted and I also spot the guy who spotted me, I will assume I'm also hidden (if I hide myself properly as mentioned above) when the guy I spotted disappears as well.
If I'm spotted but I don't spot anyone, then I would assume that I'm visible for 10s after I hide my tank.
Also note that once you think you're tank is hidden again, it's important to move from that spot and remain hidden. Unless that spot is a key point which you must hold or risk losing the match.