First of all, “八九不离十” is very very informal. Even as a native speaker of Mandarin, I seldom use it. You should be careful when you want to use this phrase.
Secondly, Your example sentence “汤姆说考试八九不离十就可以了。” sounds very strange to me. I doubt a native speaker (at least in central mainland China) will use “八九不离十” in this way.
“八九不离十” means “相差无几” "差不多","very close to the fact but not exactly the fact"
你猜的八九不离十。 (Nǐ cāi de bā jiǔ bù lí shí.)
Your guess is pretty close.
Update: An analysis of “八九不离十”
“八” = number 8 “九” = number 9 “不” = not “离” = "far away from" “十” = number 10
Literally, “八九不离十” means "number 8 and 9 are not far from number 10", "number 8 and 9 are pretty close to number 10", so it is used to mean "very close to the fact but not exactly the fact".