If X is a geodesic metric space and $$x_1,x_2,x_3\in X$$ , a geodesic triangle $$T=\{x_1,x_2,x_3\}$$ is the union of the three geodesics $$[x_1x_2]$$ , $$[x_2x_3]$$ and $$[x_3x_1]$$ in X. The space X is $$\delta $$ -hyperbolic (in the Gromov sense) if any side of T is contained in a $$\delta $$ -neighborhood of the union of the two other sides, for every geodesic triangle T in X. If X is hyperbolic, we denote by $$\delta (X)$$ the sharp hyperbolicity constant of X, i.e. $$\delta (X)=\inf \{\delta \ge 0: \, X \, \text { is }\delta \text {-hyperbolic}\}$$ . In this paper, we characterize the lexicographic product of two graphs $$G_1\circ G_2$$ which are hyperbolic, in terms of $$G_1$$ and $$G_2$$ : the lexicographic product graph $$G_1\circ G_2$$ is hyperbolic if and only if $$G_1$$ is hyperbolic, unless if $$G_1$$ is a trivial graph (the graph with a single vertex); if $$G_1$$ is trivial, then $$G_1\circ G_2$$ is hyperbolic if and only if $$G_2$$ is hyperbolic. In particular, we obtain the sharp inequalities $$\delta (G_1)\le \delta (G_1\circ G_2) \le \delta (G_1) + 3/2$$ if $$G_1$$ is not a trivial graph, and we characterize the graphs for which the second inequality is attained.