I think that there are $18$ functions of $3$ variables.
Those functions are
$x$, $y$, $z$,
$\max(x, y)$, $\max(x, z)$, $\max(y, z)$,
$\min(x, y)$, $\min(x, z)$, $\min(y, z)$,
$\max(x, \max(y, z))$, $\min(x, \min(y, z))$,
$\max(x, \min(y, z))$, $\max(y, \min(x, z))$, $\max(z, \min(x, y))$,
$\min(x, \max(y, z))$, $\min(y, \max(x, z))$, $\min(z, \max(x, y))$,
and $\max(\min(x, y), \min(z, \max(x, y)))$.
This last function simply returns the middle value among $x$, $y$, $z$.
I used Mathematica. I built a list of "basic" functions, i.e.
{x, y, z, Min[x, y], Min[x, z], Min[y, z], Max[x, y], Max[x, z], Max[y, z]}
Then I combined previous lists of function by taking Min[a,b] and Max[a,b] where a and by were elements of previous list. I deleted duplicated considering the output of the functions on the $6$ permutations of $\{1,2,3\}$.
I stopped (quite soon, actually) when new functions where not arising anymore.
ADDENDUM:
I run the same routine for $4$ variables and I got $166$ functions.
Now, searching $4,18,166$ on OEIS we got Sequence A007153, i.e.,
Dedekind numbers: number of monotone Boolean functions or antichains of subsets of an n-set containing at least one nonempty set.
The next terms escalate quickly:
$7579$, $7828352$, $2414682040996$, $56130437228687557907786$
I'm not awake enough (be honest: smart enough) to confirm or deny the connection between this problem and Dedekind numbers, but I see some potential connections.