The Morse index of a critical point of a smooth real-valued function on a smooth manifold is the largest dimension of a subspace of the tangent space on which the Hessian is negative definite. In a coordinate chart, it equals the number of negative eigenvalues of the Hessian matrix, counted with multiplicity (Milnor 1963, pp. 5-7).
In the calculus of variations in the large, the Morse index is defined using the second variation of the functional at an extremal. For the energy functional on paths with fixed endpoints, the Morse index theorem counts the index of a geodesic by the conjugate points to its starting point along the geodesic, at parameter values strictly between the endpoint times, counted with multiplicity (Milnor 1963, p. 83).