The other answers are fine, but all assume that the ground field is $\mathbb{R}$. This assumption makes sense in light of the OP's formulation of the problem, but I wanted to provide the answer for all fields.
To that end, note that if $V$ and $W$ are both $1$-dimensional fields over $\mathbb{Z}/2\mathbb{Z}$, then the unique non-trivial linear map $V\rightarrow W$ has matrix $[1]$. Indeed, both $V$ and $W$ each have a unique basis. So, there are new possibilities not appearing in the other answers.
However, the final theorem is this:
Suppose $V$ and $W$ are vector spaces over the same ground field $k$ and let $f:V\rightarrow W$ be any linear transformation. Then the matrix of $f$ is independent of the choice of basis for $V$ and $W$ iff $f$ is identically $0$, or $k = \mathbb{Z}/2\mathbb{Z}$, $V$ and $W$ are of dimension $1$ over $k$, and $f$ is the unique non-trivial linear transformation.
Let's prove this. The "if" direction is easy: if $f=0$, then the argument given by the OP for $k=\mathbb{R}$ works just fine, and the remaining case $k = \mathbb{Z}/2\mathbb{Z}$, $\dim V=\dim W = 1$ was discussed above.
So, let's focus on the "only if" direction. Here is the setup. Suppose $V$ and $W$ are both vector spaces over a field $k$ and that $f:V\rightarrow W$ is a non-zero linear transformation which has a unique matrix. Our goal is to show that $k =\mathbb{Z}/2\mathbb{Z}$, and that $\dim V = \dim W = 1$.
To that end, fix $0\neq v\in V$ with $f(v)\neq 0$. If we extend $\{v\}$ to a basis of $V$, and extend $\{f(v)\}$ to a basis of $W$, the with respect to this matrix $f$ has first column $[1,0,...,0]^t$.
Now, assume for a contradiction that $k$ contains an element $x$ which is distinct from $0$ and $1$. Then since $x\neq 0$, $x^{-1}\in k$. So, we can modify our basis of $W$ by replacing $f(v)$ with $x^{-1}f(v)$. With respect to this modified basis, $f$ now has a matrix whose first column is $[x,0,..,0]^t$. Since $x\neq 1$, this is distinct from out starting matrix, giving a contradiction. Therefore, $k$ consists of just the elements $0$ and $1$. That is, $k = \mathbb{Z}/2\mathbb{Z}$.
If $\dim V \geq 2$, then any permutation of the basis $\{v, ...\}$ we had for $V$ must give the same matrix. But permuting this basis has the effect of permuting the columns of the matrix, so all the columns must match. This means that $f$ must be constant on the basis elements. If $u$ is a basis element other than $v$, we may replace $v$ with $u+v$ and still have a basis. But $f(u+v) = 2f(v) = 0$, so now the first column of the matrix of $f$ is all $0$s. This is a contradiction.
A similarly argument applies if $\dim W \geq 2$, except that a permutation of the basis $\{f(v),...\}$ corresponds to permuting the rows of he matrix. Hence all rows have to match. But we already know that if $\dim W\geq 2$, that the first column of the matrix of $f$ has the form $[1,0,...,0]^t$, so that the first and second rows of this matrix don't match.