Its either, depending on your definition of a derivative. for concreteness suppose $x$ is $n\times 1$ and $A$ is $1\times n$. Then $f(x) =Ax$ is scalar valued, so the derivative $\frac{df}{dx}$ is a gradient vector, but what shape should a gradient vector be? This is answered by choosing how you prefer to state first order taylor approximation (the defining property of a derivative). The first of two choices is
$$ f(x+h) \approx f(x) + \frac{df}{dx}(x)\cdot h$$
i.e. $ f(x+h) \approx f(x) + (\frac{df}{dx})^T h$, which corresponds to $\frac{df}{dx}(x)=A^T$ having the same shape as $h$. The other alternative is to enforce
$$ f(x+h) \approx f(x) + \frac{df}{dx}(x) h $$
which corresponds to $\frac{df}{dx}=A $ having the shape of the transpose of $h$, $1\times n$.