"Curvature of a function" is not a standard mathematical term as far as I know, though it may be something found in a calculus textbook. If you mean the curvature of the graph of a function $y=f(x)$, then it involves the first derivative as well as the second. One can make the first derivative go away by changing the system of coordinates so that one of the axis is tangent to the curve at the point of interest. Then indeed, the second derivative $f''$ gives the curvature of the graph.
For the surface $z=f(x,y)$, assuming $\nabla f$ vanishes at the point of interest, we get the principal curvatures (plural) as the eigenvalues of the Hessian. The determinant of the Hessian gives Gaussian curvature, while the trace (that is, Laplacian $\Delta f$) gives mean curvature times two.
The relation is more complicated at the points where $\nabla f$ is nonzero, and the entire concept of curvature gets much more complex when we move from surfaces to higher-dimensional manifolds. Then the curvature cannot be adequately measured by a single number. An accessible reference is Curvatures of Hypersurfaces.