As the exponential function is strictly growing, the equation $2^x=y$ has a single real solution in $x$ (for $y>0$), which is called the logarithm (in base $2$), denoted as $\log_2(y)$.
$$2^{\log_2(y)}=y.$$
The values of $2^x$ for increasing integers $x$ are $1,2,4,8,16,32\cdots$, and for negative integers, $\dfrac12,\dfrac14,\dfrac18\dfrac1{16}\cdots$, so for instance, $\log_2(8)=3$.
The logarithm can also be computed for other values of $y$. Consider $2^x=5$, and look at the first powers of $5$,
$$5,25,125,625,3125\cdots$$
As $5^3=125\approx128=2^7$, we have $5\approx2^{7/3}$ and
$$\log_2(5)\approx\frac73=2.333333\cdots$$
As you can check,
$$2^{7/3}=\sqrt[3]{2^7}=5.0396842\cdots\approx5.$$
By using larger powers, you could find that the precise value is
$$\log_2(5)=2.3219280\cdots$$
It is worth to note that the logarithms in some base can be used for problems in another. As
$$y=2^{\log_2(y)}=5^{\log_5(y)}=(2^{\log_2(5)})^{\log_5(y)}=2^{\log_2(5)\log_5(y)},$$
$$\log_5(y)=\frac{\log_2(y)}{\log_2(5)}.$$
The logarithms are precomputed in printed tables, or evaluated by electronic calculators. They are commonly computed for base $10$, denoted $\log_{10}$ or simply $\log$, and a strange based denoted as $e=2.718281828\cdots$, denoted $\log_e$ or $\ln$. But that's another story.