The origin of constant C. Using the handbook "Handbook of exact solution to the ordinary differential equations" by Polyanin, the formula to solve the first order differential equation of the form, 
$g(x) \cdot y' = f_1(x) \cdot y + f_0(x)$
is,
$y = C \cdot e^F + e^F \cdot \int e^{-F} \cdot \frac{f_0(x)}{g(x)} dx $ 
where,
$ F = \int \frac{f_1(x)}{g(x)} dx$
The question is where does the constant C comes from?  From which integral? Integral of F or y?  Let suppose for the sake of argument, the integral is from $0$ to $x$ or $y(x) = y$ and $y(1)=a$ and $g(x) = 1$ $f_0 = x$ and $f_1 = x^2$ for integral range of $\int_1^x$. Which integral the constant C belongs to? Or how do I calculate C? 
 A: $$gy'=f_1y+f_0\implies y'=\frac{f_1}gy+\frac{f_0}g$$
Denote $F_1=\frac{f_1}g$ and $F_0=\frac{f_0}g$. Multiplying both sides of the last equation by $e^{-\int F_1~\mathrm dx}$ (this is the integrating factor of the above first order linear ODE with variable coefficients $F_1(x)$ and $F_2(x)$), we get,
$$y'e^{-\int F_1~\mathrm dx}=F_1 ye^{-\int F_1~\mathrm dx}+F_0e^{-\int F_1~\mathrm dx}$$
Rewriting, we get,
$$y'e^{-\int F_1~\mathrm dx}-y(F_1e^{-\int F_1~\mathrm dx})=F_0e^{-\int F_1~\mathrm dx}$$
Notice that the LHS is the chain rule applied on $ye^{-\int F_1~\mathrm dx}$, so we have,
$$\frac{\mathrm d}{\mathrm dx}\left(ye^{-\int F_1~\mathrm dx}\right)=F_0e^{-\int F_1~\mathrm dx}$$
The constant of integration $C$ you have there is obtained by integrating both sides of this last equation. Integrating both sides, we get,
$$ye^{-\int F_1~\mathrm dx}=C+\int F_0e^{-\int F_1~\mathrm dx}~\mathrm dx$$
Multiplying both sides by $e^{\int F_1~\mathrm dx}$ (or $e^F$ as you write) gives the final result in your post.
A: First of all, I think that this problem will be greatly clarified by the introduction of explicit limits of integration, as we shall do below; second, the given equation
$g(x)y'(x) = f_1(x) y(x) + f_0(x) \tag 1$
may only be sensibly cast in the form
$y'(x) = \dfrac{f_1(x)}{g(x)}y(x) + \dfrac{f_0(x)}{g(x)} \tag 2$
in the event that
$g(x) \ne 0 \tag 3$
over its entire range of definition.  In light of these observations, we shall assume that (1) is to be taken over some interval
$I = [x_0, x_1] \subset \Bbb R, \tag 4$
and that
$\forall x \in I, \; g(x) \ne 0; \tag 5$
under such assumptions, the form (2) is legitamit, and in fact we might as well avail ourselves of the notational simplification
$p(x) = \dfrac{f_1(x)}{g(x)}, \; q(x) = \dfrac{f_0(x)}{g(x)}; \tag 6$
then (2) becomes
$y'(x) = p(x)y(x) + q(x); \tag 7$
in addition, we place the boundary condition
$y(x_0) = y_0 \tag 8$
on $y(x)$.  
At this point we may set
$F(x) = \displaystyle \int_{x_0}^x p(s) \; ds, \tag 9$
and multiply (7) through by
$e^{-F(x)} = \exp(-F(x)) \tag{10}$
to obtain
$e^{-F(x)} y'(x) = e^{-F(x)}p(x)y(x) + e^{-F(x)}q(x), \tag{11}$
or
$e^{-F(x)}y'(x) - e^{-F(x)}p(x)y(x) = e^{-F(x)}q(x); \tag{12}$
we observe that (9) implies
$F'(x) = p(x), \tag{13}$
and also that
$F(x_0) = 0, \tag{14}$
so that
$e^{F(x_0)} = 1; \tag{15}$
we compute
$(e^{-F(x)}y(x))' = (e^{-F(x)})'y(x) + e^{-F(x)}y'(x) = -F'(x)e^{-F(x)}y(x) + e^{-F(x)}y'(x)$
$= -p(x) e^{-F(x)}y(x) + e^{-F(x)}y'(x) = e^{-F(x)}q(x), \tag{16}$
where we have used (12) and (13) in arriving at (16), which we may integrate 'twixt $x_0$ and $x$:
$e^{-F(x)}y(x) - y(x_0) = e^{-F(x)}y(x) - e^{-F(x_0)}y(x_0)$
$= \displaystyle \int_{x_0}^x (e^{-F(s)}y(s))' \; ds = \int_{x_0}^x e^{-F(s)}q(s) \; ds, \tag{17}$
whence
$e^{-F(x)}y(x) = y(x_0) + \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds, \tag{18}$
and
$y(x) = e^{F(x)} \left ( y(x_0) + \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds \right ) = y_0e^{F(x)} + e^{F(x)}\displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds, \tag{19}$
which may be readily checked by direct differentiation:
$y'(x) = (e^{F(x)})'\left ( y(x_0) + \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds \right ) + e^{F(x)}  \left ( y(x_0) + \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds \right )'$
$= F'(x)e^{F(x)}\left ( y(x_0) + \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds \right ) + e^{F(x)} \left ( \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds \right )'$
$= p(x)e^{F(x)}\left ( y(x_0) + \displaystyle \int_{x_0}^x e^{-F(s)}q(s) \; ds \right ) + e^{F(x)}e^{-F(x)}q(x) = p(x)y(x) + q(x); \tag{20}$
we thus see that (19) is indeed a complete solution to (7), with $y(x_0) = y_0$.  
We are now well-positioned to address at least some of the specific questions posed by our OP Aschoolar in his closing remarks.  "Where does the constant $C$ come from?"  Well, it ultimately originates in $y_0$; in fact, $C = y_0$, as we have shown here.  It arises naturally in (17) from the lower limit of
$\displaystyle \int_{x_0}^x (F(s)y(s))' \; ds = e^{-F(x)}y(x) - y_0, \tag{21}$
by virtue of (15); since I'm not sure what is being asked "for the sake of argument", I won't attempt to address these queries.  We "calculate $C$" by setting $C = y_0$.
