I suppose you mean it loses its IP configuration.
Next time that happens run "ip link show" "ip address show" and "ip route show"
I suspect the interface will be there, link up, but no address and route.
If using DHCP the cause might be in the router config. Check DHCP lease duration see if that matches. Check the logs.
If static config check the Pi's config or swap the SD with a "good" one.
If you're using raspios and configured networking in any other way than via /etc/dhcpcd.conf, all bets are off.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel