There was a request by Jean-Baptiste Vienney on the Category Theory Zulip for an answer to this question giving an exact characterization.
As was already mention in Taras's answer, the possibility of infinite distances does not change the class of topologies induced. Lawvere metrics that are $[0,\infty)$-valued are called quasi-metrics in a lot of the existing literature. (Although it should be noted that the word quasi-metric is also sometimes used for a more restrictive class, so the terms hemi-metric, pseudo-quasi-metric, and quasi-pseudo-metric are also sometimes used.) Given other terminology in the literature, the systematic name for the $[0,\infty]$-valued notion would be something like extended quasi-metric (or extended hemi-metric or extended pseudo-quasi-metric etc.).
The question of which topological spaces are quasi-metrizable seems to be quite old, possibly going back to the 30s when the definition was originally written down. Another terminological difficulty though is that the existing literature seems to use the term quasi-metrizable to mean slightly different things. Hung gave a characterization of what I think is a stronger property also called quasi-metrizability here. Similarly, Theorem 10.2 of Gruenhage's chapter of the Handbook of set-theoretic topology is stated as characterization of topologies induced by quasi-metrics satisfying $d(x,y) =0$ iff $x=y$, but I believe it's actually for the more general notion that answers this question. Both of these sources contain a bit of discussion about why precise characterizations of these kinds of notions seem difficult (on page 42 of Hung and 490 of Gruenhage). In particular, the best metrization theorems don't seem to bake in any uniformity requirements, but the two characterizations I cited pretty clearly involves uniform data. Because of this, I would argue that the characterization Taras already mentioned (i.e., spaces whose topologies can be induced by a quasi-uniform structure with a countable base) is probably the conceptually cleanest characterization one is going to find.
That all said, there is a nice characterization of those topologies induced by quasi-ultra-metrics or ultra-quasi-metrics (i.e., those satisfying the ultrametric inequality $d(x,z) \leq \max\{d(x,y),d(y,z)\}$):
A family $\mathcal{F}$ of open sets is called interior-preserving if arbitrary intersections of subfamilies of $\mathcal{F}$ are open.
Proposition. The topology on a topological space $(X,\tau)$ is induced by a quasi-metric satisfying the ultrametric inequality if and only if $X$ has a base that is a countable union of interior-preserving families of open sets.
(One can find this in Kofner's review of quasi-metrizability in Topology Proceedings.) One direction of this (that topologies induced by such quasi-metrics satisfy this condition) is direct: Consider the families of balls of radius $2^{-n}$ for $n < \omega$. Furthermore, since the conversion from Lawvere metrics to quasi-metrics inducing the same topology (by, for instance, $d'(x,y) = \frac{d(x,y)}{1+d(x,y)}$) preserves the ultrametric inequality, this proposition gives a nice characterization of 'Lawvere-ultrametrizable' topological spaces.
The characterization given by Gruenhage (which, again, is stated for a more restrictive notion of quasi-metric but is actually for the notion we care about here) is as follows:
Proposition. The topology on a topological space $(X,\tau)$ is induced by a quasi-metric if and only if there is a function $g : \omega \times X \to \tau$ satisfying that
(i) $\{g(n,x) : n < \omega\}$ is a neighborhood base of $x$ for each $x \in X$ and
(ii) if $y \in g(n+1,x)$, then $g(n+1,y) \subseteq g(n,x)$.
Proof. (I wrote out this proof partially to convince myself that it works since the presentation in the handbook is a bit confused and sloppy.)
First assume that $\tau$ (a topology on $X$) is induced by a quasi-metric $d$. It's straightforward from the triangle inequality that for any $x \in X$, the set $\{B(x,\varepsilon) : \varepsilon > 0\}$ is a neighborhood base of $x$. This implies that $\{B(x,2^{-n}) : n < \omega\}$ is a neighborhood base of $x$ as well. (ii) is easily seen to be satisfied by the function $g(n,x) = B(x,2^{-n})$ by the triangle inequality as well.
Now assume that we have a function $g$ satisfying (i) and (ii). Let $f(x,y)$ be defined by $f(x,y) = 2^{-k}$ where $k$ is the largest such that $y \in g(n,x)$ (with the understanding that if there is no such largest $k$ then $f(x,y) = 0$). Note that $f(x,x) = 0$ always. Frink's lemma (Lemma 2.6 in Gruenhage on page 430) says that if $f : X \times X \to [0,\infty)$ satisfies the statement
- for any $\varepsilon > 0$, if $f(x,y) < \varepsilon$ and $f(y,z) < \varepsilon$, then $d(x,z) < 2\varepsilon$,
then there is a function $d: X \times X \to [0,\infty)$ such that $d(x,z) \leq d(x,y) + d(y,z)$ and $\frac{1}{4}d(x,y) \leq f(x,y) \leq d(x,y)$. It's fairly immediate that this is satisfied by $f$: If $\varepsilon > 1$, then the statement is trivial. Otherwise, fix $\varepsilon \in (0,1]$ and find $k$ such that $\varepsilon \in (2^{-k-1},2^{-k}]$. Assume that $f(x,y) < \varepsilon$ and $f(y,z) < \varepsilon$. Then we actually have that $f(x,y) \leq 2^{-k-1}$ and $f(y,z) \leq 2^{-k-1}$. Therefore we have that $y \in g(k+1,x)$ and $z \in g(k+1,y)$. This implies that $g(k+1,y) \subseteq g(k,x)$, so $z \in g(k,x)$ and $f(x,z) \leq 2^{-k}<2\varepsilon$. So let $d: X \times X \to [0,\infty)$ be the function guaranteed to exist by Frink's lemma.
First note that since $f(x,x) =0$ always, we have that $\frac{1}{4}\cdot 0 \leq d(x,x) \leq 0$. Therefore $d(x,y)$ is a quasi-metric on $X$. To see that $d$ induces the topology $\tau$, it is sufficient to show that for every $x \in X$, every $d$-ball is a $\tau$-neighborhood of $x$. For any $\varepsilon > 0$, we have that the $d$-ball $B(x,\varepsilon)$ has $g(n,x)$ as a subset provided that $\varepsilon \leq 2^{-n}$, so this does work. Therefore $d$ induces $\tau$. $\square$
It was an open problem for a long time whether the condition that characterization could be relaxed to a non-uniform version, specifically satisfying that for every $n < \omega$ and $x \in X$, there is an $m < \omega$ such that if $y \in g(m,x)$, then $g(m,y) \subseteq g(n,x)$. Spaces admitting such a function are called $\gamma$-spaces and it was eventually resolved negatively. (I'm not sure by whom originally, but Gruenhage mentions that Fox provided an example of a regular $\gamma$-space that is not quasi-metrizable.) It seems that under various extra assumptions, being a $\gamma$-space implies quasi-metrizability. For instance, Kofner mentions a theorem of Junnila that developable $\gamma$-spaces are quasi-metrizable. Also it was shown in a recent paper of Liu and Lin that hyperspaces with the Vietoris topology are quasi-metrizable if they are $\gamma$-spaces.
It is reasonable to guess that perhaps having a countably locally finite base would be a necessary and sufficient condition for quasi-metrizability, given the role that this condition plays in the Nagata–Smirnov metrization theorem. It was shown by Sion and Zelmer that a weaker condition is actually sufficient:
Theorem (Sion and Zelmer Theorem 2.2). If a topological space has a base that is a countable union of point-finite families of open sets, then it is quasi-metrizable.
(Thankfully Sion and Zelmer are pretty careful about spelling out what they mean by 'quasi-metric,' so I'm sure this is relevant.) Of course a family $\mathcal{F}$ of open sets is point-finite if every $x$ is only in finitely many elements of $\mathcal{F}$.
They also give an example of a (Hausdorff, normal) quasi-metric space with no base satisfying the assumption of the theorem. (In particular the space does not have a countably locally finite base.)
Example (Sion and Zelmer Example 3.2). $[0,1]$ with the quasi-metric $d(x,y) = y-x$ if $x \leq y$ and $d(x,y) = 1$ if $y < x$ is Hausdorff and normal but has no base that is a countable union of point-finite families of open sets.
Note that the topology here is the Sorgenfrey topology on $[0,1]$ (i.e., the lower or maybe upper limit topology, I can't quite get it straight in my head which it is at the moment), which is of course a classic topological counterexample.