Check/uncheck the tool button (either in the menu, ribbon tab or in a toolbar) to enable/disable it. Select an object in the viewport. An overlay displaying the object Z-position will be drawn.