If a circuit takes more than one qubit as its input and has quantum gates which take different numbers of qubits as their input, how would we interpret this circuit as a matrix?
Here is a toy example:
The first gate is a Hadamard gate which is normally represented by $$\frac{1}{\sqrt{2}}\begin{bmatrix}1&1\\1&-1\end{bmatrix}$$
Now, since we're only applying it to the first qubit, we use a kronecker product on it (this confused me so much when I was starting out - I had no idea how to scale gates; as you can imagine, it's rather important), so we do $H\otimes I$, where $I$ is the 2x2 identity matrix. This produces
$$\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 0 & 1 & 0\\0 & 1 & 0 & 1\\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1\end{bmatrix}$$
Next we have a CNOT gate. This is normally represented by
$$\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{bmatrix}$$
This is the right size for two qubits, so we don't need to scale using kronecker products. We then have another hadamard gate, which scales the same was as the first. To find the overall matrix for the circuit, then, we multiply them all together:
$$\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 0 & 1 & 0\\0 & 1 & 0 & 1\\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1\end{bmatrix}\begin{bmatrix}1&0&0&0\\0&1&0&0\\0&0&0&1\\0&0&1&0\end{bmatrix}\frac{1}{\sqrt{2}}\begin{bmatrix}1 & 0 & 1 & 0\\0 & 1 & 0 & 1\\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1\end{bmatrix}$$
and get
$$\frac{1}{2}\begin{bmatrix}1&1&1&-1\\1&1&-1&1\\1&-1&1&1\\-1&1&1&1\end{bmatrix}$$
(if python multiplied correctly =) We would then multiply this by our original qubit state, and get our result.
So basically, you go through each gate one by one, take the base representation, and scale them appropriately using kronecker products with identity matrices. Then you multiply all the matrices together in the order they are applied. Be sure to do this such that if you wrote out the multiplication, the very first gate is on the far right; as arriopolis points out, this is a common mistake. Matrices are not commutative! If you don't know the base representation of a matrix, check first wikipedia's article on quantum gates which has a lot.