To and from the spindle along it's rotational axis is Z
The major cross axis 90 degrees to Z is X.
The minor cross axis 90 degrees to Z is Y.
That is the standard, long held convention. It all relates to the spindle axis.
Using that language, a vertical mill like a Bridgeport has Z up and down, X left and right, and Y closer and further away. A horizontal mill that looks somewhat similar has Z toward and away, X left and right, and Y up and down. A surface grinder has the same nomenclature as the horizontal mill, because it is laid out the same as a horizontal mill in reference to the spindle.
That said, with CNC machines, which may have many axes, that might move in any direction and orientation, and with many people thinking the Bridgeport mill orientation sets the standard for left/right, up/down, and closer/farther, people are calling axes anything they want, using techie sounding letters, but leaving people misunderstanding what they are describing.
I, personally, am currently making an attempt to not use those letters at all any more. I am using descriptive terms like up/down, left/right, closer/farther, toward/away, and in/out.
The common goal is communication. If we all individually invent our own languages, it is very difficult to communicate...
Standards are put in place for really good reasons.