There is no reason for your computer to disconnect from the LAN, unless you access it through a remote (dial-up) connection.
If you are directly connected to the LAN, I would suspect either a physical defect on a NIC, or a problem with you Windows 98 configuration.
If you are connected through a dial-up networking, the disconnection is almost unavoidable. You would need to manually re-dial the connection.
Your explanation about pinging is incomplet, the ping command will always work regardless of the connection status, only the actual answer will differ. "reply properly" is insufficient.
Does name resolution work?
You can ping either an URL or an IP.
If you ping an URL and it returns an IP, then name resolution is working, meaning that your PC is still on the network, and therefore has some kind of local system problem.
If it does not return an IP, then you are not on the network, and look for a possible hardware problem, first.