To get issued with an IP address automatically, you need to connect your PC to something called a DHCP server, otherwise you set an IP address for your PC, phone, tablet or other kind of similar device by hand in the settings for the network interface. Your router will contain a DHCP server, so plug your PC into the router, not into the modem.