Remember that things can rotate. So there is no definitive way to do this. All you can do is set a convention.
A popular one would pair this
But you shouldn't assume those words evoke these images for everyone. Indeed there is not a set universal convention for them.
Some others even insist that height and depth are the same thing and insist on adding length (which never helped me since any direction can be a length).
Still others swap x y and z around. I like this one only because it keeps x and y close to where they were in 2D.
In the end you have to set your own convention. Make it clear and stick to it.
Edit: How should I name 2D vs 3D sizes? Should I keep using height in 2D (y axis) even if in 3D height is for z axis?
Simple, don't do that. The moment you change either of the associations previously established in 2D you're destined to create confusion. There is no fixing it. 3D height can't be for the z axis if 2D height is something else.
Now as I said, objects rotate within axis. Height is has nothing to do with the z axis unless you happen to rotate the object so that it does. If you insist that all objects be initialized into that rotation, or that they don't ever rotate, then this is an unfortunate inconsistency that is most easily resolved by making depth align with the z axis in 3D and the other two consistent with 2D. Which happens to be exactly what the images I posted suggest doing.
What I suspect you're really trying to do is communicate the association the 3 axis and the 3 size parameters have in that initial position. There are a few ways to do that.
Implicitly, using parameter position
Position3D(x, y, z)
Size3D(w, h, d)
Explicitly, usings comments:
data class Size3D( //Initial alignments:
val width: Int, //x axis
val height: Int, //y axis
val depth: Int //z axis
But in no case would I recommend the name
xAmount. That just creates a different kind of confusion. If you must go this way use the name pattern: