Let $T$ be a totally ordered set.
The supremum of a subset $S \subseteq T$, if it exists, is
an element $s \in T$ such that (1) $s$ is an upper bound of $S$, and (2) for all $x$ which are upper bounds of $S$, $x \ge s$.
You can prove that if such an $s$ exists then it is unique using the properties of a total order.
It is certainly not guaranteed that a supremum exists. For instance, $\varnothing$ only has a supremum if $T$ has a minimum element.
The set $\{x \;:\; x^2 \le 2\}$ has no supremum in $\mathbb{Q}$.
And unbounded sets in $\mathbb{R}$ do not have any supremum.
In particular, supremums do not always exist in the real numbers. Only bounded, nonempty subsets of $\boldsymbol{\mathbb{R}}$ have a least upper bound.
However, it is convenient when speaking of the supremum on real number sets to consider subsets of the extended real numbers, $\overline{\mathbb{R}} = \mathbb{R} \cup \{-\infty,\infty\}$ instead of subsets of the real numbers.
If you do this, then every subset of $\boldsymbol{\overline{\mathbb{R}}}$ has a least upper bound, and $\sup$ is a well-defined function from $\mathcal{P}(\overline{\mathbb{R}})$ to $\overline{\mathbb{R}}$.
For example:
$\sup \varnothing = -\infty$,
$\sup \{-\infty\} = -\infty$,
$\sup \mathbb{R} = \infty$,
and so on.
A maximum of $S \subseteq T$ is simply a supremum of $S$ such that $s \in S$.
Often supremums are not maximums; $[0,1)$ has supremum $1$ but no maximum (in $\mathbb{R}$). $\varnothing$ has supremum $-\infty$ but no maximum (in $\overline{\mathbb{R}}$).
Unlike with supremums, whether or not a set has a maximum does not depend on which set it is contained in.
So
$\mathbb{R}$ has no supremum as a subset of itself, but does have a supremum in $\overline{\mathbb{R}}$.
$\mathbb{R}$ has no maximum in either itself or in $\overline{\mathbb{R}}$.
Any set with a maximum has a supremum, so supremum is a strictly more general notion than maximum.