I assume you're confused between the integral and SDE writings of Ito's lemma, since the two equations you have are indeed different.
Let $X_t$ be an Ito process defined by
$$
X_t = X_0 + \int_0^t \alpha_s \, ds + \int_0^t \sigma_s \, dW_s
$$
for adapted processes $\alpha_s$ and $\sigma_s$ (and assuming some technical boundedness condition on the integrals). This equation may be written in shorthand as an SDE as
$$
dX_t = \alpha_t dt + \sigma_t dW_t.
$$
The SDE is not rigorous - it is simply a shortcut way of writing down the integrals above, and provides a bit of intuition behind the evolution of $X$ over "infinitesimally small" time intervals.
Now consider a measurable function $f: [0,T] \times \mathbb{R} \to \mathbb{R}$ such that
$$
f(\cdot,x)\in C^1([0,T]) \quad \forall x \in \mathbb{R},
$$
and
$$
f(t,\cdot) \in C^2(\mathbb{R}) \quad \forall t \in [0,T].
$$
I would argue the correct (mathematically rigorous) way of stating Ito's lemma is
$$ f(T,X_T) = f(0,X_0) + \int_0^T \frac{\partial}{\partial t}f(s,X_s)
\, ds + \int_0^T \frac{\partial}{\partial x}f(s,X_s) \, dX_s \\
\qquad
+ \frac{1}{2}\int_0^T \frac{\partial^2}{\partial x^2}f(s,X_s) \, d<X,X>_s $$
The quantity $<X,X>_s$ is the quadratic variation accumulated by the Ito process $X$ up until time $s$. You can show (Shreve II, page 143-144, e.g.) that this is given by
$$
<X,X>_s = \int_0^s \sigma^2_u \, du,
$$
or, in differential (shorthand) form as
$$
d<X,X>_s = \sigma^2_s \, ds.
$$
Plugging this into Ito's lemma gives your first equation.
Now, just like the Ito process $X$ was written in shorthand as an SDE, so may $f$, since it, too, is an Ito process. That is, we also have
$$ df(t,X_t) = \frac{\partial}{\partial t}f(t,X_t)dt +
\frac{\partial}{\partial x}f(t,X_t) dX_t +
\frac{1}{2}\frac{\partial^2}{\partial x^2}f(t,X_t) d<X,X>_t. $$
The first boxed equation had precise mathematical meaning. The second boxed equation is just shorthand for the first.
Update: Your second equation is often called Ito's product rule. Ito's lemma is "usually" stated for functions of one Ito process as it was for my answer above. If you have a function of two Ito processes then both processes' quadratic variation and cross variation appear in Ito's lemma, aka Ito's product rule. See Shreve II, page 168, e.g. for a decent explanation