What are all the possibilities of $A$ s.t. $\det(A)=k$? 
Suppose we have $A \in M_3(\Bbb N\cup\{0\})$ s.t. sum of the elements of each row is $k $ for some fixed $k\in \Bbb N\cup\{0\}$. What are all the possibilities of $A$ s.t.  $\det(A)=k$?

We can start from 


*

*$k=0$ here we have to have the matrix to be zero.

*For $k=2$, I am getting $$
    \begin{pmatrix}
    1 & 1 & 0 \\
    0 & 1 & 1 \\
    1 & 0 & 1 \\
    \end{pmatrix}
$$ as one such matrix then what are the other possibilities and can you give me a general question.

*Then what about $k=1,3$
And so on for any $k$ can we give a general structure?
Then this question can be extended to $A\in M_4(\Bbb N \cup{0})$.
By the way, what I want is if someone can give me some of the partial answers as the general answer might be too strong to expect!
 A: This answer is not complete, but it reduces the problem to finding all triangles of area $\frac12$ with nonnegative integer coefficients that lie within $x+y\leq k$ (within the 2-simplex with edges of length $k$).
Let $$A=\begin{bmatrix}a&b&c \\ d&e&f \\ g&h&i\end{bmatrix}$$ with all the entries in $\{0,1,\ldots,k\}$. The conditions being imposed are:


*

*$a+b+c=k$

*$d+e+f=k$

*$g+h+i=k$

*$c(dh-eg)+f(gb-ah)+i(ae-bd)=k$
Using the first three equations to eliminate $c,f,i$, the fourth equation gives:
$$
(k-a-b)(dh-eg)+(k-d-e)(gb-ah)+(k-g-h)(ae-bd)=k
$$
Expanding the products, many terms annihilate each other. For example $(-a)(dh)$ from the first product and $(-d)(-ah)$ from the second. It leaves:
$$
\begin{align}
k(dh-eg)+k(gb-ah)+k(ae-bd)&=k\\
dh-eg+gb-ah+ae-bd&=1\\
\det\begin{bmatrix}d-a&e-b\\g-a&h-b\end{bmatrix}&=1\\
\text{twice the area of }\triangle(a,b)(d,e)(g,h)&=1
\end{align}
$$
where the vector edges of the triangle, $\langle d-a,e-b\rangle$ and $\langle g-a,h-b\rangle$ are oriented counterclockwise.
This means that for every triangle in $\mathbb{R}^2$ with vertices in $\{0,1,\ldots,k\}^2$, where the vertices satisfy $x+y\leq k$, and the area of the triangle is $\frac{1}{2}$, and for each choice of orientation for $(a,b),(d,e),(g,h)$, we get a matrix of the prescribed form.
For example, when $k=7$, one such triangle is $(5,1)(4,2)(0,5)$ (a counterclockwise traversal). So we may take $a=5,b=1,d=4,e=2,g=0,h=5$. Then we recall this means $c=k-a-b=1$, $f=k-d-e=1$, $i=k=g=h=2$. And this matrix works:
$$A=\begin{bmatrix}5&1&1 \\ 4&2&1 \\ 0&5&2\end{bmatrix}$$
(Check that its rows sum to $7$ and its determinant is $7$.)
For $k=1$, there is only one such triangle, with vertices $(0,0)$, $(1,0)$, and $(0,1)$. There are three ways to identify the points $(a,b)$, $(d,e)$, $(g,h)$, giving rise to three matrices $\begin{bmatrix}1&0&0 \\ 0&1&0 \\ 0&0&1\end{bmatrix}$, $\begin{bmatrix}0&1&0 \\ 0&0&1 \\ 1&0&0\end{bmatrix}$, $\begin{bmatrix}0&0&1 \\ 1&0&0 \\ 0&1&0\end{bmatrix}$.
For $k=2$, I think I count $10$ such triangles, leading to $30$ such matrices.
For $k=3$, I count $35$. I may have made a mistake, but I think I have an exhaustive enumeration that calculates the count as $2(3^2+2^2+1^2+4\cdot2+3\cdot1)-(3\cdot4+3)=35$. Each has three orientations, so this would make $105$ such matrices.
For $k=4$, I count $88$, but I grow less certain my counting method is accurate.

I'd conjecture that this geometric equivalence generalizes. For the $n\times n$ version of the problem, look for all $n$-sets of points (the triangles in the $n=3$ case) within the $(n-1)$-simplex of edge length $k$, where the [hyper]volume encased by the $n$-set of points is $\frac{1}{(n-1)!}$ (the smallest possible nonzero [hyper]volume for such a thing). Each such $n$-set has $\frac{1}{2}n!$ positive orientations for enumerating the elements of the set. Each such $n$-set along with one of its positive orientations provides you with the first $n-1$ columns of a matrix, and the last column is determined by the requirement that rows sum to $k$. 
The conjecture is verified for $n=2,3$. And it even works in a vacuous sense for $n=1$.
Maybe someone has studied how to count/enumerate/identify/parametrize all such $n$-sets. However for $n=3$, based on my counts above, I would expect either $\{1,10,35,88\}$ or $\{3,30,105,264\}$ to appear in the OEIS if this has been studied. But neither sequence appears.
A: (It looks like this answer is subsumed by alex.jordan's answer, albeit he arrived at the $\det=1$ conclusion in a more computationally intensive manner than I did.)
It's actually pretty easy to check the determinant condition in the case when we consider $A$ to be a $3 \times 3$ matrix:
If $$A = \begin{pmatrix} a & b & c \\ d & e & f \\ g & h & i\end{pmatrix},$$ with $$a+b+c=d+e+f=g+h+i=k,$$
then $$v = \begin{pmatrix}1 \\ 1 \\ 1\end{pmatrix}$$ is an eigenvector for $A$ with eigenvalue $k$. In particular, let $V= \mathbb C^{\oplus 3}$ be the vector space that $A$ acts on, and we find that $\mathbb C v \subseteq V$ is an invariant subspace for $A$. Therefore it is sensible to ask how $A$ acts on the quotient vector space $V/\mathbb C v$. If we take $e_1, e_2, e_3$ to be the standard basis for $V$, then one basis for $V/\mathbb C v$ is given by $e_1 + \mathbb C v, e_2 + \mathbb C v$. Then it's not too difficult to see that the matrix of the transformation on $V/\mathbb C v$ with respect to this basis is given by
$$\begin{pmatrix}a-g & b-h \\ d - g & e-h\end{pmatrix},$$
i.e., subtracting the last row from the first two rows, taking only the first two columns.
Since $v$ has eigenvalue $k$ already, Asking for the determinant to be $k$ amounts to asking that the remaining eigenvalues multiply to $1$, i.e., that the determinant of this last matrix, $(a-g)(e-h)-(b-h)(d-g)$ is one.
So the procedure you could follow to classify all possible $A$ is:


*

*First classify all elements of $SL_2(\mathbb Z)$ with integer entries of absolute value at most $k$,

*For each one of those matrices, find all possible ways to express that matrix in the form $$\begin{pmatrix}a-g & b-h \\ d - g & e-h\end{pmatrix}$$ with $a, b, d, e, g, h \in \mathbb N \cup \{0\}$, and each of $a+b, d+e, g+h \le k$,

*For each resulting possibility, fill in $c$, $f$, $i$ using the condition that the rows add up to $k$.
Since $SL_2(\mathbb Z)$ is relatively easy to understand, this shouldn't be too computationally intensive for small values of $k$. If you want to consider $A$ to be higher order square matrices, then the problem gets more complicated - for $A$ to be $n \times n$, you need to understand $SL_{n-1}(\mathbb Z)$.
