Yes that's true. You can show it even a bit more generally. Take a real vector space $V$ with a scalar product $\langle\cdot,\cdot\rangle$. Then take an operator $T:V\to V$ such that $\langle x,Ty\rangle=\langle y,Tx\rangle=\langle Tx,y\rangle\quad\forall x,y\in V$. We show that $T$ is a linear operator:
Let $x\in V$, $y_1,y_2\in V$ and $a\in\mathbb{R}$. Then $$\langle x,T(ay_1+y_2)\rangle=\langle Tx,ay_1+y_2\rangle=a\langle Tx, y_1\rangle+\langle Tx,y_2\rangle=\\
=a\langle x, Ty_1\rangle+\langle x,Ty_2\rangle=\langle x,aTy_1+Ty_2\rangle$$
Since $x$ was arbitrary it implies that $T(ay_1+y_2)=aTy_1+Ty_2$
In your case the vector space is just $\mathbb{R}^n$ and the scalar product is the usual dot product, so $\langle x,y\rangle=x^Ty$