If you specify that the thread has to be 20mm deep the hole has to be drilled slightly deeper to allow for the taper that is on the end of the tap. Probably the hole will need to be about 1-1/2 to 2 threads deeper which is about 4mm. If it is not possible to drill the hole 24mm deep you will not get 20mm of full thread.
On the male threads it is possible to get very close to the full length threaded; only the last thread would be incomplete. However on these it is a simple matter to specify an undercut at the bottom of the thread so that the mating part can screw tight against the end.
You could also specify an undercut at the bottom of the internal thread to make it possible to screww something right to the bottom, but this is finicky to do and will likely increase your cost.