This problem is mostly know as Kissing Number problem and is mostly applied in Spheres.

This problem states that the number of non overlapping unit spheres which can be arranged such that they touch other given unit sphere.

In question since it's asked about squares we need to appreciate square as having four equal sides, which makes it obvious that only four other such squares can be attached to it's four sides!

Hench the maximum number being asked is 4.