I believe your question (and many other variations) are answered here. Also see this survey by I. Barany about extremal problems for convex lattice polytopes.
Actually the problem for the convex polygon inside the square was considered earlier than that. See here for an article that seems to be written more in the lines of your question. The result is that $$K(n)\sim 2\pi \left(\frac{n}{12}\right)^{2/3}.$$