Hmm. I was hoping someone who actually knows algebraic geometry would write an answer to this question.
First, some intuition. As it turns out, complex projective non-singular algebraic curves are the same thing as (connected) compact Riemann surfaces, which topologically are compact oriented surfaces. By the classification of compact surfaces, such surfaces are uniquely classified by a single number, their genus $g$, which counts how many holes there are in the surface. More precisely, for every $g$ there is an oriented surface $S_g$ which is the connected sum of $g$ tori (that is, it's a "doughnut with $g$ holes"), and every (connected) compact orientable surface is homeomorphic to $S_g$ for a unique $g$.
The genus $g$ has several equivalent definitions, and some of these generalize to algebraic geometry where we do not have direct access to topological information. Unfortunately, none of them are particularly easy to describe. An excellent introduction to this subject can be found in Fulton's Algebraic Curves.
So the idea is clear for non-singular curves. However, the genus turns out to be a birational invariant of curves (in particular, invariant under deletion of finitely many points), so it is possible to extend the definition of the genus to singular curves by declaring the genus of a singular curve to be the genus of a non-singular curve birational to it.
Example. Consider the singular curve $y^2 = x^3$ of degree $3$ in $\mathbb{P}^2(\mathbb{C})$ (equivalently $\mathbb{A}^2(\mathbb{C})$). It has a singular point at the origin of order $2$. Now, a non-singular curve of degree $3$ in $\mathbb{P}^2(\mathbb{C})$ has genus $1$ (see elliptic curve), but this curve doesn't: in fact, using the birational map $t \mapsto (t^2, t^3)$ we see that this curve is birational to $\mathbb{P}^1(\mathbb{C})$, hence has genus $0$.
So we see from the above that, roughly speaking, singularities decrease the "expected" genus of a curve (where "expected" means the number $\frac{(d-1)(d-2)}{2}$ that one gets from the genus-degree formula). Exactly how much singularities decrease the expected genus appears to me to be a somewhat complicated question and I am not the one to discuss it in detail. However, for "ordinary" singular points (I am not sure exactly what this means) of order $r$ it seems that the genus gets decreased by $\frac{r(r-1)}{2}$. So the genus in your first example is
$$\frac{9 \cdot 8}{2} - 3 \frac{5 \cdot 4}{2} - \frac{4 \cdot 3}{2} = 36 - 30 - 6 = 0$$
and the genus in your second example is
$$\frac{4 \cdot 3}{2} - \frac{3 \cdot 2}{2} - 3 \frac{2 \cdot 1}{2} = 6 - 3 - 3 = 0.$$
Your formula is wrong, we don't have $l \cdot l = h^0(l, \mathcal O_l)$. Indeed in this case $l \cdot l = 0$ and $h^0(l, \mathcal O_l) = 1$.
Actually you don't need so much machinery. It's easy to see that $\mathbb P^1 \times \{ p\}$ is linearly equivalent to $\mathbb P^1 \times \{ q\}$ for any $p,q \in \mathbb P^1$. By basic properties of intersection product, you obtain $l \cdot l = 0$.
If you want to use the adjunction formula, then as Mohan suggests you can try to compute the canonical class. To do this, you can notice that $\Omega_X \cong p_1^* \Omega_{X_1} \oplus p_2^* \Omega_{X_2}$ if $X = X_1 \times X_2$ and $p_i : X_i \to X$ is the projection.
Best Answer
People frequently write $H$ when they mean $H|_X$, which is probably the source of part of your confusion. To compute $H|_X^2$, one strategy you can use is from the end of problem V.1.2: if $D$ is a very ample divisor on a surface $X$ and $C$ is a curve on $X$, then the intersection product $D.C$ is the degree of the curve $C$ under the embedding $X\hookrightarrow \Bbb P^N$ determined by $D$. (Sketch: since all the linearly equivalent representatives of $D$ correspond to hyperplanes in $\Bbb P^N$, pick a good representative which intersects $C$ nicely, apply proposition V.1.4 which says $C.D=\sum_{P\in C\cap D} i(C,D;P)$ if $C,D$ are curves with no common component, and recognize that this is also the degree of $C\cap H$ by Bezout's theorem.) As the embedding induced by $H$ is the already-supplied embedding in $\Bbb P^3$, you're now asking for the degree of a hyperplane section of a degree $d$ surface in $\Bbb P^3$. By Bezout, this is $d$.
There's no need to apply the adjunction formula to compute $(p^*K_C)^2$. Instead, you can just find two representatives which don't intersect and apply proposition V.1.4 again. If $C$ is $\Bbb P^1$, then $K_C\sim -P-Q$ for any two points $P,Q\in\Bbb P^1$, so $p^*K_C\sim -[C'\times\{P\}]-[C'\times\{Q\}]$ for any choice of $P,Q\in\Bbb P^1$, and intersecting two representatives with no points in common gives an intersection product of 0 (again by proposition V.1.4). If $C$ is a different smooth curve, then by an answer to one of your previous questions, $K_C$ is base-point free, so we can find two representatives of $K_C$ which have no points in common. Then we can do the same thing - write $p^*K_C\sim C'\times S_1$ and $p^*K_C\sim C'\times S_2$, where $S_1$ and $S_2$ are two finite sets of disjoint closed points in $C$, and then apply proposition V.1.4 to get that $(p^*K_C)^2=0$ since those divisors don't intersect. To compute the final answer to this portion of the exercise, use that the center term is the intersection of a bunch of vertical and horizontal fibers (so the intersections are transversal) and count the number of intersection points.