The router is responsible for forming the network. The gateway IP is only used when more than one router/network are used so that the other routers can find the one connected to WAN (internet). If you have only one router and its IP is 192.168.1.1, then both computers should has an IP of 192.168.1.x in order to be considered on the same network. Normally a router is left with dchp turned on so that the router assigns the IP's not the individual. Should you desire a static IP, this is usually done in the router's configuration page so that the router always assigns the same IP, rather than manually at the computer or device. The dchp range is also set in the router's configuration page, where I believe the default is usually set at 192.168.1.100 - 200, giving the router the ability to assign 100 computers/devices IP numbers. Sometimes in a house or business, a second router is used to expand wifi connectivity. In this type of setup, the router connected to the WAN/internet is the primary router. The secondary router has its dchp turned off so that only the primary router assigns IP's. The secondary router requires the gateway IP which will be the IP of the primary router, so that all devices connected to the secondary router have the path to the primary router for their internet connection.