There are many categories of graphs, so perhaps it's best to take a synoptic view.

The table below surveys several categories of directed graphs (DG), directed multigraphs (DM), undirected graphs (UG), and undirected multigraphs (UM). The asterisks indicate the ones which are *not* cartesian closed, in each case lacking a terminal object.

\begin{array}{lcccc}
& DG & DM & UG & UM \\
\text{Loops allowed} & 10 & 2 & 12 & 3\\
\text{Loops allowed and reflexive} & 9 & 1 & 11 & 4\\
\text{Loops allowed and strictly reflexive} & 9 & 7 & 11 & 8 \\
\text{Loops not allowed} & 13* & 5* & 14* & 6*
\end{array}
The concepts of reflexive and strictly reflexive graphs are distinct for multigraphs, but the same for graphs, which is why numbers 9 and 11 are duplicated in the table.

(1) For a category theorist, the default category of graphs to use is the category of *reflexive, directed multigraphs where loops are allowed*. In this category, from a vertex $v$ to a vertex $w$ there is a *set* of edges $E(v,w)$ (the "multi" part), there is no relationship between $E(v,w)$ and $E(w,v)$ (the "directed" part), for every vertex $v$ there is a distinguished edge $i_v \in E(v,v)$ (the "reflexive" part) and there are no other restrictions on $E(v,v)$ ("loops are allowed"). A morphism $f$ is a map of vertex sets and a map of edge sets preserving incidence relations and such that $f(i_v) = i_{f(v)}$. This category is cartesian closed -- in fact it can be described as the functor category $\mathcal{R}^{op} \to Set$ where $\mathcal{R}$ is (a skeleton of) the category of linearly ordered sets of cardinality 1 or 2 (this category has 2 objects and 5 nonidentity morphisms).

(As observed by Dmitri Pavolov above, a category of functors into $Set$ is always cartesian closed).

(2) A variation is the category of *directed multigraphs where loops are allowed*. This is similar to the previous category, but we drop the distinguished vertices $i(v)$. This category is also cartesian closed -- it is the category of functors $\mathcal I^{op} \to Set$ where $\mathcal I$ is (a skeleton of) the category of linearly ordered sets of cardinality 1 or 2 and injective homomorphisms (this category has two objects and two nonidentity maps).

(3) Another variation is the category of *undirected multigraphs where loops are allowed*. This is similar to the previous category, but there is a specified bijection between $E(v,w)$ and $E(w,v)$ which must be preserved by morphisms (and this bijection is the identity when $v=w$). This is cartesian closed -- it is the category of functors $\mathcal U^{op} \to Set$ where $\mathcal U$ is (a skeleton of) the category of sets of cardinality 1 or 2 and injective maps (this category has 2 objects and 3 nonidentity morphisms).

(4) Another variation is the category of *reflexive undirected multigraphs where loops are allowed*. This is like the previous category, but we add back the distinguished loops $i(v)$. This category is cartesian closed; it is the functor category $\mathcal T^{op} \to Set$ where $\mathcal T$ is (a skeleton of) the category of sets of cardinality 1 or 2 (this category has 2 objects and 6 nonidentity morphisms).

(5) The category of *directed multigraphs where loops are not allowed* is not cartesian closed. It doesn't have a terminal object.

(6) Similarly, the category of *undirected multigraphs where loops are not allowed* is not cartesian closed because it doesn't have a terminal object.

(7) The category of *strictly reflexive directed multigraphs* consists of reflexive directed multigraphs satisfying $e \in E(v,v) \Rightarrow e = i(v)$ (the objects may equivalently be thought of as directed loop-free multigraphs, with slightly more homomorphisms). This category is localization of reflexive directed multigraphs, and it can be checked that the localization induces a cartesian closed structure.

(8) Similar comments apply to *strictly reflexive undirected multigraphs*.

Moving away from multigraphs,

(9) Consider category of *directed reflexive graphs where loops are allowed*. This category is a localization of the multigraph version, and it can be checked that the localization induces a cartesian closed structure. Similarly, (10) *directed graphs where loops are allowed*, (11) *undirected reflexive graphs where loops are allowed*, and (12) *undirected graphs where loops are allowed* are cartesian closed, with the cartesian closed structure induced by localization from the multigraph version. Note that in particular an undirected reflexive graph is equivalent to a simple graph, with a few more morphisms in the category.

(13) The category of *directed loop-free graphs* is not cartesian closed, and nor is the category of (14) *undirected loop-free graphs*. They fail to have terminal objects, as Wojowu observed.

I think Wojowu's further observations are also spot-on, to the effect that the failure of cartesian closedness is not just some technicality about terminal objects. Rather, in order to have cartesian closedness, it is essential to allow morphisms that collapse an edge to a point. The "naive" definition of morphism of simple graphs does not allow this; we must add such morphisms. A slick way to do this is to just pretend for the purposes of morphisms that there is a loop at every point.