The hostname of a device is typically also the device name. On a Windows PC, the computer name is the hostname. On some home routers, you can set the hostname of the router as well. The .local and .lan are local, non-routable, domains.
The hostname is most commonly used by DNS (domain name system) to map IP Addresses to domain names, but can also map hostnames to IP addresses. The part after the hostname is the domain, delineated by the dots [.].
On the internet, you are familiar with the .com domains. DNS works so you can go to SuperUser's website by typing https://superuser.com into a browser, instead of https://151.101.193.69. DNS gets more far more complicated then that, and there are many resources online that discuss how DNS works. On the internet we are usually dealing with subdomains (superuser is a subdomain of the com domain) and aliases and not hostnames, but a lot of the principles are the same.
On a local area network, the PC keeps a cache of known DNS entries, and our local router also serves as the DNS server for the network. With Windows networking and our router DNS cache, we can use the client hostnames in our LAN directly, instead of their IP addresses. It usually isn't necessary to include the .local domain to access a PC, computers in a windows network can be browsed to using their hostname directly.
On a LAN, the domains .local and .lan are used because they are "non-routable" domains. This means that traffic destined for these domains will not be forwarded on the internet.
A Windows PC by default is part of the .local domain, so it can be reached on the local network by browsing to .local, without any further setup in the network.
Your router manufacturer has configured the default domain on the router to be .lan. If this domain is also configured on the DHCP options for your local network, then your PCs can also be reached by .lan. You could change this domain to .local on the router.
Running ipconfig /all in a command prompt will provide you additional details about your network and domains on the network adapters.