The clear and concise answer is: It doesn't matter what units you use, be it AU and years, kilometres and seconds, yards and fortnights - as long as you're consistent.
A more verbose answer follows.
Since Kepler's 3rd has the form:
##T^2 \propto a^3##
It's a statement about proportionality. The factor of proportionality is ##\frac{4\pi^2}{GM}##. So if you were to use the expression as:
##T^2 = \frac{4\pi^2}{GM} a^3##
then you'd have to make sure units in G and M are consistent with those you use for T and a. E.g. if you use AU for distance, you need to make sure you rescale G to be in units of ##N AU^2/kg^2##.
But, since it's a statement about proportionality, it tells you that the expression
##\frac{T^2}{a^3} = const## for all planets (of a given star).
This means, that you'd normally use it to compare two planets around the same star. So, let's say you use it for two planets 1 and 2:
##\frac{T_1^2}{a_1^3} = \frac{T_2^2}{a_2^3}##
...and as long as you remembered to use the same units for both planets, all the units work out regardless of what they are.
For example. I've just came up with fanciful units for distance [glork] and time [splork].
Planet 1 orbits at a distance of 10 glorks, with a period of 1 splork.
Planet 2 orbits with a period of 20 splorks.
You want to know something about the orbital distance of the second planet, so you write:
##\frac{T_1^2}{a_1^3} = \frac{T_2^2}{a_2^3}##
##a_2 = \sqrt[3]{\frac{T_2^2 a_1^3}{T_1^2}}##
And you read the right hand side as 'that many glorks'.
Or, equivalently, you write:
##\frac{T_1^2}{a_1^3} = \frac{T_2^2}{a_2^3}##
##\frac{a_2}{a_1} = \sqrt[3]{\frac{T_2^2}{T_1^2}}##
And you read that as ##a_2## is 'that many times' larger/smaller than ##a_1##. Where 'that many times' is dimensionless.