Question: Given an $n \times n$ matrix $A$, we can define a linear transformation $T: \mathbb{R}^n \rightarrow \mathbb{R}^n$ by $T(x)=Ax$.

We could also define a bilnear function $T: \mathbb{R}^n \times \mathbb{R}^n \rightarrow \mathbb{R}$ by $T(x,y) = y^TAx$.

Is there a relation between these two uses of the matrix?

Also, we could do the same thing with an $n \times m$ matrix and get a linear function $\mathbb{R}^m \rightarrow \mathbb{R}^n$ and a bilinear function $\mathbb{R}^m \times \mathbb{R}^n \rightarrow \mathbb{R}$. Is the relationship between using $A$ to define a linear function versus a bilinear function the same in this case?

Answer: 
Any bilinear form $b\colon \mathbb R^n\times\mathbb R^n\to\mathbb R$ naturally corresponds to a linear map $\Phi\_b\colon \mathbb R^n\to(\mathbb R^n)^\*$, where $(\mathbb R^n)^\*=\operatorname{Hom}(\mathbb R^n,\mathbb R)$ is the dual space. This correspondence is given by
\begin{align}
b \quad\longmapsto\quad \Phi\_b\colon\mathbb R^n&\to(\mathbb R^n)^\*,\\
x &\mapsto b(x,-).
\end{align}
Here $b(x,-)$ denotes the linear map $\mathbb R^n\to\mathbb R$ sending $y$ to $b(x,y)$.

Considering the elements of $\mathbb R^n$ as column vectors, we can consider the elements of $(\mathbb R^n)^\*$ as row vectors: for $\rho\in(\mathbb R^n)^\*$ and $x=(x\_1,\dots,x\_n)^T$ we have
\begin{align\*}
\rho(x) &= \rho(x\_1 e\_1+\cdots+x\_n e\_n) = x\_1 \rho(e\_1) +\cdots + x\_n \rho(e\_n)
\\&= \begin{pmatrix} \rho(e\_1) & \rho(e\_2) & \dots & \rho(e\_n)\end{pmatrix}
\begin{pmatrix} x\_1 \\ x\_2 \\ \vdots \\ x\_n\end{pmatrix}.
\end{align\*}
Using this identification, there is an isomorphism ${}^T\colon(\mathbb R^n)^\*\to\mathbb R^n$ given by $y\mapsto y^T$.

Now starting with $b(x,y) = y^TAx$ this yields $\Phi\_b(x)=(y\mapsto y^TAx)$ which we identified with the row vector $\Phi\_b(x)=(Ax)^T$. Using the above isomorphism we then obtain a linear map $\mathbb R^n\to\mathbb R^n$:
\begin{align}
\mathbb R^n &\xrightarrow{\Phi\_b}\ (\mathbb R^n)^\*\ \xrightarrow{T} \mathbb R^n,\\
x &\longmapsto (Ax)^T \mapsto Ax.
\end{align}

This is how starting with the bilinear map defined by $A$ we obtain the linear map defined by $A$. You can of course go in the other way as well.

---

More abstractly you can think of this in terms of the [tensor-hom adjunction](https://en.wikipedia.org/wiki/Tensor-hom_adjunction) together with the (basis dependent!) isomorphism $(\mathbb R^n)^\*\cong(\mathbb R^n)$:
\begin{align}
\{\text{bilinear maps $\mathbb R^n\times\mathbb R^n\to\mathbb R$}\}
&\leftrightarrow
\operatorname{Hom}(\mathbb R^n\otimes\mathbb R^n,\mathbb R)
\\&\cong
\operatorname{Hom}(\mathbb R^n,\operatorname{Hom}(\mathbb R^n\to\mathbb R))
\\&=
\operatorname{Hom}(\mathbb R^n,(\mathbb R^n)^\*)
\\&\cong
\operatorname{Hom}(\mathbb R^n,\mathbb R^n).
\end{align}
Given
$$
{\bf y}\_{\,1}
 = \left( {\matrix{ {y\_{1,1} } \cr \vdots \cr {y\_{h,1} } \cr } } \right)
 = {\bf A}\,{\bf x}\_{\,1} 
$$
then
$$
{\bf Y}
 = \left( {\matrix{ {y\_{1,1} } & \cdots & {y\_{1,h} } \cr \vdots & \ddots & \vdots \cr 
 {y\_{h,1} } & \cdots & {y\_{h,h} } \cr } } \right)
 = {\bf A}\,{\bf X}
$$

Therefore
$$
{\bf Y}^{\,T} {\bf Y} = {\bf Y}^{\,T} {\bf A}\,{\bf X}
 = {\bf X}^{\,T} {\bf A}^{\,T} {\bf A}\,{\bf X}
 = \left( {\matrix{ {{\bf y}\_{\,1} \cdot {\bf y}\_{\,1} } & \cdots
 & {{\bf y}\_{\,1} \cdot {\bf y}\_{\,h} } \cr \vdots & \ddots & \vdots \cr 
 {{\bf y}\_{\,h} \cdot {\bf y}\_{\,1} } & \cdots & {{\bf y}\_{\,h} \cdot {\bf y}\_{\,h} } \cr 
 } } \right)
$$