What are local homomorphisms, geometrically? For want of a better name, let us say that a ring homomorphism $f : A \to B$ is local if it (preserves and) reflects invertibility, i.e. $f (a)$ is invertible in $B$ (if and) only if $a$ is invertible in $A$. (A local ring homomorphism is then a local homomorphism in this sense whose codomain is a local ring; note that the domain is then automatically a local ring.)
Question. Is there a property of morphism $\operatorname{Spec} f : \operatorname{Spec} B \to \operatorname{Spec} A$, expressible geometrically, that is equivalent to the property of $f : A \to B$ being local?

In view of the early answers given, here is a conjecture:
Conjecture. $f : A \to B$ is a local homomorphism if and only if the set-theoretic image of $\operatorname{Spec} f : \operatorname{Spec} B \to \operatorname{Spec} A$ contains all the closed points (of $\operatorname{Spec} A$).
The conjecture is true if $B$ is a local ring, and also when $f : A \to B$ is surjective, as shown by @zcn below. In the general case, the "if" direction holds: indeed, if every maximal ideal of $A$ is the preimage of some ideal of $B$, then $f : A \to B$ preserves non-units, hence is local. What about the converse?
 A: I don't know about a purely geometric property, but here's a more explicit algebraic version (by the way, since local homomorphism already has a clear (and different!) meaning to me, I will instead say reflects units):
Notice that if $f : A \to B$ reflects units, then $f : A \to f(A)$ reflects units. Thus we consider only surjective ring maps $f : A \twoheadrightarrow A/I$ ($I = \ker f$), and for these there is a characterization:
$\DeclareMathOperator{\Rad}{\operatorname{Rad}}$
$\DeclareMathOperator{\Spec}{\operatorname{Spec}}$
Proposition: The canonical projection $\pi : A \to A/I$ reflects units iff $I \subseteq \Rad(A)$ (the Jacobson radical).
Proof: Suppose $I \subseteq \Rad(A)$. If $a \in A$ is a unit mod $I$, then $1 - ab \in I$ for some $b \in A$, so $ab \in 1 + I \subseteq 1 + \Rad(A) \subseteq A^\times$, hence $a, b \in A^\times$. Conversely, if $I \not \subseteq \Rad(A)$, then there exist $a \in I$, $b \in A$ with $1 - ab \not \in A^\times$, but $\pi(1 - ab) = \overline{1}$ is a unit in $A/I$. 
Without surjectivity, the situation becomes stranger - one can still say that if $f : A \to B$ reflects units, then $\ker f \subseteq \Rad(A)$, but the converse need not hold (e.g. as mentioned, any nontrivial localization of a domain is a counterexample). If $Z$ is the scheme-theoretic image closure of $\Spec(B) \to \Spec(A)$, then as usual, the closed immersion $Z \hookrightarrow \Spec(A)$ is easy to deal with, but the epimorphism $\Spec(B) \to Z$ is not.
Update: With regard to your conjecture, the classic $k[x,y] \to k[x,y]$, $x \mapsto x, y \mapsto xy$ seems to be a counterexample. This map reflects units (all concentrated in degree $0$), but is not surjective as a map of varieties, hence not on closed points. Notice that the image does factor through a proper open subscheme.
A: A trivial reformulation is the following: A morphism of affine schemes $X \to Y$ is local when $Y$ is the only principal open subscheme of $Y$ through which $X \to Y$ factors.
(It does not follow that $Y$ is the only open subscheme of $Y$ through which $X \to Y$ factors.)
