Where exactly do the orbital angular momentum get their numbers e.g. +1/2
$$
\newcommand{\linop}[1]{\hat{#1}}
\newcommand{\ramuno}{\mathrm{i}}
\newcommand{\ket}[1]{\,|{#1}\rangle}
$$

Classical Mechanics

In classical mechanics, the angular momentum, $\vec{L}$, of a particle with respect to a chosen origin is given by the vector product of its position vector relative to the origin, $\vec{r}$, and its linear momentum, $\vec{p}$,
\begin{equation*}
    \vec{L} := \vec{r} \times \vec{p} \, .
\end{equation*}
By expanding $\vec{r}$ and $\vec{p}$ over a standard basis $\{ \vec{i}, \vec{j}, \vec{k} \}$ of a Cartesian coordinate system as $\vec{r} = x \vec{i} + y \vec{j} + z \vec{k}$ and $\vec{p} = p_x \vec{i} + p_y \vec{j} + p_z \vec{k}$ and then writing the cross product as the formal determinant [1] and expanding it one could obtain 
\begin{equation}
    \vec{r} \times \vec{p}
    =
    \begin{vmatrix}
     \vec{i} &amp; \vec{j} &amp; \vec{k} \\
           x &amp;       y &amp;       z \\
         p_x &amp;     p_y &amp;     p_z \\
    \end{vmatrix}
    =
    (y p_z - z p_y) \vec{i} - (x p_z - z p_x) \vec{j} + (x p_y - y p_x) \vec{k} \, ,
\end{equation}
which implies that components $(L_x, L_y, L_z)$ of the angular momentum in terms of which it can be expressed over a standard basis as $\vec{L} = L_x \vec{i} + L_y \vec{j} + L_z \vec{k}$ are given as follows
\begin{equation}
 L_x = (y p_z - z p_y) \, ,
 \quad
 L_y = (z p_x - x p_z) \, ,
 \quad
 L_z = (x p_y - y p_x) \, .
\end{equation}
The magnitude, $L$, of the angular momentum is given as usual as the square root of the scalar product of the vector with itself, $L := \sqrt{\vec{L}\vec{L}}$, or, in terms of components,
\begin{equation*}
    L := \sqrt{L_x^2 + L_y^2 + L_z^2} \, .
\end{equation*}

Quantum Mechanics

Operators

The quantum mechanical analogue of classical angular momentum is known as the orbital angular momentum and the operators for the components of orbital angular momentum can be obtained by simply replacing the components of position and momentum in classical mechanical expressions by the corresponding operators
\begin{equation}
    \linop{L}_{x} = (\linop{y} \linop{p}_z - \linop{z} \linop{p}_y) \, ,
    \quad
    \linop{L}_y = (\linop{z} \linop{p}_x - \linop{x} \linop{p}_z) \, ,
    \quad
    \linop{L}_{z} = (\linop{x} \linop{p}_y - \linop{y} \linop{p}_x) \, .
\end{equation}
and the square of the magnitude of the angular momentum operator can be expressed in terms of these operators as follows
\begin{equation}
    \linop{L}^2 = \linop{L}_{x}^2 + \linop{L}_y^2 + \linop{L}_{z}^2 \, .
\end{equation}
Then the following commutation relations of the angular momentum operators can be easily established:
\begin{equation}
    [ \linop{L}_{x}, \linop{L}_{y} ] = \ramuno \hbar \linop{L}_{z} \, ,
    \quad
    [ \linop{L}_{y}, \linop{L}_{z} ] = \ramuno \hbar \linop{L}_{x} \, ,
    \quad
    [ \linop{L}_{z}, \linop{L}_{x} ] = \ramuno \hbar \linop{L}_{y} \, ,
\end{equation}
\begin{equation}
    [\linop{L}^2, \linop{L}_{x}] = [\linop{L}^2, \linop{L}_y] = [\linop{L}^2, \linop{L}_{z}] = 0 \, .
\end{equation}

Interestingly, in quantum mechanics there exist a different kind of angular momentum, the intrinsic angular momentum, or spin, which does not have a counterpart in classical mechanics. 
While the intrinsic angular momentum components operators does have a different form from that of orbital angular momentum, the commutation relations between them and the square of the intrinsic angular momentum magnitude are exactly the same.

More interestingly, the angular momentum can be treated in such a way that the treatment relies entirely on the commutation relations just introduced, and as such, valid for any kind of angular momentum.
Thus, for generality we can use the letter $J$ for any kind of angular momentum reserving the letter $L$ specifically for orbital one.
\begin{equation}
    [ \linop{J}_{x}, \linop{J}_{y} ] = \ramuno \hbar \linop{J}_{z} \, ,
    \quad
    [ \linop{J}_{y}, \linop{J}_{z} ] = \ramuno \hbar \linop{J}_{x} \, ,
    \quad
    [ \linop{J}_{z}, \linop{J}_{x} ] = \ramuno \hbar \linop{J}_{y} \, ,
\end{equation}
\begin{equation}
    [\linop{J}^2, \linop{J}_{x}] = [\linop{J}^2, \linop{J}_y] = [\linop{J}^2, \linop{J}_{z}] = 0 \, .
\end{equation}

Eigenvectors and eigenvalues

According to the commutation relations above, $\linop{J}^2$ commutes with all three components $\linop{J}_{x}, \linop{J}_y, \linop{J}_{z}$ while the components do not commute with each other.
Thus, $\linop{J}^2$ and one (and only one) of the components operators, conventionally chosen to be $\linop{J}_{z}$, admit the set of simultaneous eigenvectors, and using the so-called ladder operators technique it can be shown that,
\begin{align}
    \linop{J}^2 \ket{j(j+1),m} &amp;= j(j+1) \hbar^{2} \ket{j(j+1),m} \, , \\
    \linop{J}_{z} \ket{j(j+1),m} &amp;= m \hbar \ket{j(j+1),m} \, , 
\end{align}
where $\ket{j(j+1),m}$ is a simultaneous eigenvector of $\linop{J}^2$ and $\linop{J}_{z}$, $j$ could take non-negative integer and half-integer values,
\begin{equation*}
    j = 0, 1/2, 1, 3/2, \cdots \, ,
\end{equation*}
and $m$ ranges from $-j$ to $j$ in integer steps
\begin{equation}
    m = -j, -j+1, \cdots, j-1, j \cdots \, .
\end{equation}

Then, as I already said in my comment with respect to half-integer values of $j$, for orbital angular momentum, where the Born interpretation requires cyclic boundary conditions to be satisfied, only integer values are admissible, but where cyclic boundary conditions are not relevant, as for the intrinsic angular momentum known as spin, the half-integer values might be appropriate.

Epilogue

I'm still not sure what this question is about, but if it specifically about the spin of an electron, i.e. "How do we now that its component in any direction is $\pm 1/2$ in the units of $\hbar$?", then we know it both from the experiment (the Stern–Gerlach one) and the theory (the quantum field theory). And yes, for electron only these values are possible, but for other particles there might be different possibilities. Thus, for instance, a photon have component of the spin in any direction  $\pm 1$ in the units of $\hbar$.



[1] Here, "formal" means that this notation has the form of a determinant, but does not strictly adhere to the definition; it is a mnemonic used to remember the expansion of the cross product.