Definition. A function is said to be injective if $f(x_1) = f(x_2) \implies x_1 = x_2$ or, equivalently, $x_1 \neq x_2 \implies f(x_1) \neq f(x_2)$.
Horizontal Line Test. A horizontal line intersects the graph of an injective function at most once.
Proof. Suppose otherwise. Then there exists a horizontal line $y = k$ and an injective function $f$ whose graph intersects the line $y = k$ at two points, $(x_1, k)$ and $(x_2, k)$, with $x_1 < x_2$. Then $f(x_1) = f(x_2) = k$. Since $f$ is injective, $f(x_1) = f(x_2) \implies x_1 = x_2$, which contradicts our assumption that $x_1 < x_2$. Thus, a horizontal line can intersect the graph of an injective function at most once.$\blacksquare$
You observed that the line $y = -5$ does not intersect the graph of the function $f(x) = 2^x$. Notice that this does not contradict the definition of an injective function since we do not have two different $x$-values that produce the same $y$-value.

The function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = 2^x$ is injective since for each $y$ in its range, there is exactly one value of $x$ such that $f(x) = y$, namely $x = \log_2 y$.
Definition. A function $f: X \to Y$ is said to be surjective if for each $y \in Y$, there exists $x \in X$ such that $f(x) = y$, that is, if its range, $f(X) = \{f(x) \mid x \in X\}$, is equal to its codomain, $Y$.
The function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = 2^x$ is not surjective since its range, $\text{Ran}_f = (0, \infty)$, is not equal to its codomain, $\mathbb{R}$.
Definition. A function is said to be bijective if it is both injective and surjective.
The example $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = 2^x$ demonstrates that an injective function is not necessarily a bijective function.
We can transform an injective function into a bijective function by restricting the codomain to equal its range. For instance, if we restrict the codomain of the function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = 2^x$ to $(0, \infty)$, we create a bijective function $g: \mathbb{R} \to (0, \infty)$ defined by $g(x) = 2^x$. Since a function is specified by its domain, its codomain, and its graph (the set of ordered pairs that satisfy the function), $g \neq f$ since the functions $f$ and $g$ have different codomains.
It is not necessarily true that if a horizontal line crosses the graph of a function more than once that the function is surjective. For instance, the $x$-axis crosses the graph of the function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = \sin x$ infinitely many times, but $f$ is not surjective since its range, $\text{Ran}_f = [-1, 1]$, does not equal its codomain, $\mathbb{R}$.
What we can say is that the function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x) = \sin x$ is not injective since it fails the Horizontal Line Test.
If a function $f: X \to Y$ is surjective, then for each $k \in Y$, the horizontal line $y = k$ must intersect the graph of $f$ at least once. Otherwise, there would be no $x \in X$ such that $f(x) = k \in Y$.
If a function $f: X \to Y$ is bijective, then for each $k \in Y$, the horizontal line $y = k$ will intersect the graph of $f$ exactly once since it must intersect the graph of $f$ at least once for the function to be surjective and at most once for the function to be injective.