I think what you want to do is to count the number of distinct lines. Your condition with the GCD only works when you are in $\mathbb Z$ or something like that. In $\mathbb F_p$ it's a little different. In the following I consider two lines to be the same if they have the same set of solutions, just to make sure I am clear.
There are $p$ lines of the form $ax = c$ and $a \neq 0$, because the set of solutions for those is just $(a^{-1} c, y)$ with $y$ ranging from $0$ to $p-1$ ; hence $a^{-1}c = A$ for some $A$ and the lines are just $(A,y)$ with $y \in \mathbb F_p$. There is also $p$ lines of the form $by = c$ with $b \neq 0$ for the same reasons. If $a=b=c=0$ then the line is the set of all couples $(x,y)$. If $a=b=0 \neq c$ then you get the empty line. Hence by considering $a=0$ or $b=0$ I got $2p+2$ lines. You distinguish what you consider a line or not in the latter. (You might not want to consider the empty line as a line.)
Assume from now on that $a \neq 0 \neq b$. A line of the form $ax + by = 0$ is always of the form $y = Ax$ with $A = b^{-1}a$. There are $p-1$ such lines, since $A$ can range from $1$ to $p-1$ and clearly all those lines are distinct.
It remains to consider the case where $c \neq 0$. In fact, if $ax + by = c$, then $y = Ax + C$, and by translating we have $y = A(x-A^{-1} C) + C = Ax - C + C = Ax$. Hence adding the constant $c$ gives us $p-1$ new lines for each value of $A$, and they are just translates of the old lines of the form $y=Ax$.
In the end, there are $(2p+2) + p(p-1) = p^2 + p + 2$ lines if you consider the empty set as a line, and $p^2 +p+1$ if you don't.
Hope that helps,