To make sure it's sterile doesn't take long. If you want to get as much of the tanin out as you can, replace the water as it turns dark until it stays clear. How long that takes depends on the size. I've been done with small pieces inside of a couple hours, but I have a friend who's had a big piece in her garage now for three weeks and the water still turns coffee color overnight.
The tanins aren't harmful to fish (many seem to benefit from them to some extent), so you can't just let it leach out over time. As much boiling and soaking as you do sometimes it just won't seem to make any difference, or it'll seem to be clear but still leach once you get it in the tank. Either way, it's nothing to worry about. A very light tanin staining actually looks rather nice in a tank, though too much can get unsightly. Fresh filter carbon and increased water changes both will help remove it until it stops.