Specifically for curves on surfaces, you can look at Barth-Hulek-Peters-Van de Ven Chapter II, Section 10 ("Intersection numbers") for a quick summary. The idea is as follows. For noncompact spaces, you can still define a nondegenerate pairing between $H^k(X)$ and $H^{dim(X)-k}_c(X)$ where the subscript c means compactly supported cohomology (and dim means real dimension). This is because when you wedge an arbitrary form with something compactly supported, you get something compactly supported which you can integrate. Since you can integrate an arbitrary differential form over a compact subvariety, or a compactly-supported form over an arbitrary subvariety, this allows you to define an intersection theory between compact and noncompact cycles. The only thing you can't do this way is define a well-behaved intersection number between two noncompact subvarieties (which you wouldn't expect to because they can "intersect at infinity").