That depends on whose definition of socket you use and in some cases whether the packet is opening a new connection or transferring data for an existing connction.
The RFC that defines TCP defines the term socket as a combination of an IP address and a port. By this definition the two packets have the same socket on the server side but different sockets on ...
The initial 5 rows of the IP header are always used.
So, minimum length of IP header = 5 x 4 bytes = 20 bytes.
The size of the 6th row representing the Options field vary.
The size of Options field can go up to 40 bytes.
So, maximum length of IP header = 20 bytes + 40 bytes = 60 bytes.