In mathematics, this usage of a vertical bar means "restricted to". Example: Given a function $f$ mapping the set $\mathbb{R}$ of real numbers (its domain) into some set $S$, the expression $f\mid_{[0,1]}$ means a function whose domain is just the interval $[0,1]$ (a subset of $\mathbb{R}$) and whose values there agree with those of $f$.
As a specialization, if a single element $x$ of $f$'s domain is given as the restriction argument, then $f\mid_x$ may be taken to mean $f(x)$, and $f\mid_{x=x_0}$ is then the same as $f(x_0)$. A slight generalization of this is the shorthand notation used with definite integrals
$$\int_a^b f(x) \mathrm{d}x = F(x)\mid_{x=a}^b = F(b)-F(a)$$
If $f$ has several parameters, say $x\in\mathbb{R}$ and $y\in\mathbb{R}$, then that $f$ has domain $\mathbb{R}\times\mathbb{R}$, and $f\mid_{x=x_0}$ is $f$ restricted to the domain $\{x_0\}\times\mathbb{R}$, whereas $f\mid_{y=y_0}$ is $f$ restricted to the domain $\mathbb{R}\times\{y_0\}$. You will notice the formal inconsistency with the single-parameter case, where the result of an explicit restriction to one point is usually not considered a function anymore, but just the value it takes there. As a workaround, you might write $f\mid_{\{x_0\}}$ to make sure the result is still a function.
In physics and engineering where symbols tend to represent physical entities rather than functions with a defined domain, there is an additional specialization: Restrictions of the form $\frac{\partial f}{\partial x}\!\mid_y$ where $x,y$ are variables (again usually representing physical entities) mean that $f$ shall be regarded as a function of $x$ and $y$ when doing the differentiation, with the consequence that the partial derivative $\frac{\partial f}{\partial x}$ is the same as the total derivative along a path where $y$ is held constant.
For example, in thermodynamics, the heat capacity (i.e. energy required per temperature change) for constant volume $V$ is typically written as
$$C_V=\left.\frac{\partial U}{\partial T}\middle|_V\right.$$
meaning that the internal energy $U$ must be formulated as a function of temperature $T$ and volume $V$ before partial derivation can formally take place. This matters because it is in some sense more appropriate to regard the internal energy $U$ as a function $U(S,V)$ where $S$ is entropy, rather than as $U(T,V)$. That is, when given $U$ in terms of $S$ and $V$, you need to express $S$ in terms of $T$ and $V$ before you can calculate $C_V$.