You can simply add nodes to paths. This can be done with either
\draw (x) -- (y) node [midway] {w} ;
if you use the standard syntax for drawing edges. or with
\draw (x) -- to node[] {w} (y) ;
if you prefer the 'to' form.
Normal position of the node is the exact middle of the line, but you can add any parameter to tweak the position of the node (left,right,above,below or x/yshift).
This nodes can also follow the edge orientation (sloped). In that case, the parameters are defined with respect of the edge direction and you will mostly use above of below.
Here is an example with either normal or sloped weights. I used both the 'to' and '--' form.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}
\begin{tikzpicture}[
vertex/.style = {shape=circle,draw,minimum size=2em},
edge/.style = {->,-Latex},
]
% Vertices
\node[vertex] (s) at (0,0) {s};
\node[vertex] (t) at (2,-2) {t};
\node[vertex] (v) at (-2,-2) {v};
\node[vertex] (w) at (2,-5) {w};
\node[vertex] (u) at (-2,-5) {u};
% Edges
\draw[edge, ultra thick] (s) -- (t) node[midway,right] {$w_{st}$} ;
\draw[edge, ultra thick] (s) to node[left] {$w_{sv}$} (v);
\draw[edge, ultra thick] (t) to node[right] {$w_{tw}$} (w);
\draw[edge, ultra thick] (v) to node[left] {$w_{vu}$} (u);
\draw[edge] (t) to node[above, xshift=8mm] {$w_{tu}$} (u);
\draw[edge] (v) to node[above, xshift=-8mm] {$w_{vw}$} (w);
\end{tikzpicture}
\hfill%
\begin{tikzpicture}[
vertex/.style = {shape=circle,draw,minimum size=2em},
edge/.style = {->,-Latex},
]
% Vertices
\node[vertex] (s) at (0,0) {s};
\node[vertex] (t) at (2,-2) {t};
\node[vertex] (v) at (-2,-2) {v};
\node[vertex] (w) at (2,-5) {w};
\node[vertex] (u) at (-2,-5) {u};
% Edges
\draw[edge, ultra thick] (s) -- (t) node[midway,above,sloped] {$w_{st}$} ;
\draw[edge, ultra thick] (s) to node[above,sloped] {$w_{sv}$} (v);
\draw[edge, ultra thick] (t) to node[above,sloped] {$w_{tw}$} (w);
\draw[edge, ultra thick] (v) to node[below,sloped] {$w_{vu}$} (u);
\draw[edge] (t) to node[above left, sloped] {$w_{tu}$} (u);
\draw[edge] (v) to node[above right, sloped] {$w_{vw}$} (w);
\end{tikzpicture}
\end{document}
