Double-click a ruler.
(Windows) Choose Edit > Preferences > Units & Rulers, or right-click the ruler and then choose a new unit from the context menu.
(Mac OS) Choose Photoshop > Preferences > Units & Rulers, or Control-click the ruler and then choose a new unit from the context menu.