Let $f: X \to Y$ be a morphism of schemes over a field $k$ such that $f$ induces (1) a bijection between their closed points, and (2) an isomorphism of their Zariski tangent spaces.

Under these conditions, is $f$ always an isomorphism? And if not, under what additional (mild, hopefully) assumptions could one conclude it is an isomorphism?

I'm looking, in particular, for references with a precise statements and proofs that (under some conditions) $f$ is an isomorphism.

For example, maybe $X$ and $Y$ need to be smooth, or satisfy some finiteness condition.. or maybe $f$ is always an isomorphism, I don't know.