Value for Z-axis affect the Y-axis
In Align to: View mode, the cube is created as the user has the view oriented:




Whereas in World mode, the cube is created aligned with the world axes (irrespective of the user's view):





Also, make sure your transform orientation is set to Global is you want to transform your object based on world axes: