Let $f:X\to Y$ be a morphism of varieties over a field $k,$ such that $X(\overline{k})\to Y(\overline{k})$ is bijective. Is $f$ necessarily an affine morphism?

No. Here is an example: Let $g:\mathbb A^2\to Y$ be a morphism that glues two closed points $P$ and $Q$ together and otherwise it is an isomorphism. Now let $X=\mathbb A^2\setminus \{P\}$ and $f$ the restriction of $g$ to $X$. If you add to the conditions that $f$ is projective, then the statement is true, because then $f$ is finite and hence affine. EDIT: A minute ago there was another question asking how to define $Y$. It has now disappeared, but perhaps it is still interesting to include some references. 1) See this MO question and the discussion. 2) See this paper of Karl Schwede. Especially, Theorem 3.4 in general and Corollaries 3.6 and 3.9 in particular. 3) Try to construct it directly. If you get stuck, look at Karl's paper and try to carry out the computation in this special case. It might be a worthy exercise if you have never done anything like this before. 

