It's easy to see that $Y$ has at most $n^2$ elements. If you have more than $n^2$ ordered $n$-tuples, then by the pigeonhole principle two of them share the same first two components.
Whether you can always achieve $n^2$ is not clear to me. I suspect I'm overlooking some simple construction. Anyway, for $n=2$ as you note we can achieve 4. For $n=3$ there are lots of ways of achieving 9: $$\{{123,132,213,231,312,321,111,222,333\}}$$ is one way, another is $$\{{112,121,211,223,232,322,331,313,133\}}$$ and another is $$\{{111,122,133,212,223,231,313,321,332\}}$$
EDIT: here's a solution for $n=4$: $$\matrix{1111&1234&1342&1423\cr2222&2143&2431&2314\cr3333&3412&3124&3241\cr4444&4321&4213&4132\cr}$$ I found this by using the field of 4 elements, $F=\{{0,1,\alpha,\beta\}}$, and taking the two-dimensional subspace of $F^4$ spanned by $(1,1,1,1)$ and $(0,1,\alpha,\beta)$, and then renaming the elements of $F$, 1, 2, 3, 4. This ought to work if $n$ is the order of a finite field, that is, if $n$ is a prime power. But maybe there's a simple construction I'm not seeing that works for all $n$.