Presumably the PC is configured to get its setting from the DHCP server in the router (this is the common option).
Check the router to see what address range it is configured for. Some will operate for the entire subnet, if so change it so that there is an unallocated range.
So as an example your router might be on 192.168.0.1 and its range is set to 192.168.0.1 to 192.168.0.254 (it does not matter if one of the range includes its own address, it would not issue it).
Adjust one end to leave an unallocated space so it starts for example at 192.168.0.32 which would leave nothing getting the address from 192.168.0.2-31.
Now on the PC go to the network settings and turn off Automatically get address. Set the values in that unallocated range but the important bit is to set the default gateway the same as the PC computer address i.e.
IP Address: 192.168.0.24
Subnet Mask: 255.255.255.0
Default Gateway 192.168.0.24
The DNS server can still be the router so that you can still access other PCs by name. The default gateway tells the PC what device to go to when it wants to connect to an address not on your network. All internet sites by definition are not on your network so if the default gateway is wrong it cannot access the internet. PCs which are on your network do not require access to the default gateway to talk to each other. Setting to an actual value of a working system reduces the timeout that would occur.