This is true if you assume that $H$ is a normal subgroup.
If $[G:H]$ is prime, then you can prove that $H$ must be maximal by proceeding as in the other answer. If you know that $H$ is a normal maximal subgroup, then $[G:H]$ must be prime. This follows from the correspondence theorem: you can show that $G/H$ has no nontrivial proper subgroups and thus must be cyclic of prime order.
However, in general this statement is false. For example, in the alternating group $A_4$ subgroups of order $3$ are maximal and have index $4$, which is not prime.
For solvable groups we have the following result.
If $G$ is a finite solvable group and $M < G$ is a maximal subgroup, then $[G:M]$ is a power of a prime.
This is not true for groups that are not solvable, as the alternating group $A_5$ shows.