What is the exact difference between router and gateway? In Network configuration we set the default gateway ip address, but in reality we call the device configured with that ip address as router?
Router describes the general technical function (layer-3 forwarding) or a hardware device intended for that purpose, while gateway describes the function for the local segment (providing connectivity to elsewhere). You could also state that "you set up a router as gateway". Another term is hop which describes the forwarding in between subnets.
It's just a matter of perspective, the device is the same.
What is the exact difference between router and gateway?
A router is a device/service that provides the function of routing IP packets between networks.
A gateway (in network terms) is a router that provides access for IP packets into and/or out of the local network.
In Network configuration we set the gateway ip address, but in reality we call the device configured with that ip address as router?
Specifically, the gateway you are likely referring to is the default gateway which is the router to which a client (or source device) sends IP packets that are destined somewhere other than the local network and for which the client has no "better" route.
A gateway always has to be a router, but a router does not have to be a gateway.
A router is a layer 3 device i.e It cannot modify the IP address of the packet, it can only change the MAC Address it can route the packet, whereas a gateway could be NAT capable, or can act as a firewall in case of a NAT-capable gateway it can change the packet's IP address and more capable gateways can block traffic
Layer2 Devices - Switches
Layer3 Devices - Routers
Layer2- Layer7 Devices - Gateways/Firewalls/IDC (usually implement DPI -deep packet inspection)
Gateways are distinct from routers or switches in that they communicate using more than one protocol and can operate at any layer of the 7 layer OSI model of networking. - Wikipedia