Given $k$ strictly positive real numbers $l_1,\dots,l_k$, can one decide the existence of a periodic tiling of the plane whose fundamental domain is the union of $k$ squares of length $l_1,\dots,l_k$?

For $k\leq 2$, such tilings exist always.

How can one construct them in case of existence?

(Fun example: given a natural integer $n$ are there always (at most) four such lengths given by non-negative integers $a,b,c,d$ with $n=a^2+b^2+c^2+d^2$?)

Added: One can always decide the existence theoretically since there are a finite number of possible graphs (given by boundary of squares) on the resulting quotient-torus. This is however not usable in practice.