Turn on TV, make the connection. Open the router internal program. Find the MAC address of the TV and give it a static IP address. You may also need to go into security settings and set it to always allow that MAC to connect automatically.
My new Samsung 4K TV (UN50KU6300) in my bedroom disconnects from the internet whenever the TV is turned off for even a short period of time. When the TV is initially turned on, there is no internet connection even though the router is close by and the wifi signal strength is very strong. I have to re-input my security code each time (or connect using WPS) and the internet then immediately reconnects. As long as the TV is turned on, the connection is fine and there are no disconnection problems. However, when the TV is turned off the internet disconnects.
I have been troubleshooting for months and tried nearly every possible fix that I can find (e.g. change settings, use manual or modified IP settings, manually add new or existing network, unplug, factory reset, software updates, use reserved DHCP, try unsecured guest network, etc, etc. etc.), but the problem continues. I even exchanged the TV in hopes that there was something defective with my first unit, but the new TV is doing the exact same thing. I called Samsung support one time and the agent was worthless.
The only troubleshooting I have not yet tried is a different router. But why? I have had three other Samsung TVs connected to my same routers without any internet disconnection problem. I never had this problem with my prior bedroom TV which was another Samsung HD TV in the same spot as my new one. I also have had two different Samsung TVs in my den, the newest being a recently purchased 4K model (UN65KS8000), all of which have never had any disconnection problem. Only my new bedroom unit has this problem.
It seems to me that the TV for some reason is not saving my login security code when turned off, but that’s just my best guess. I really am stumped and can’t believe this problem cannot be resolved. I have read other reviewers complaining about the exact same problem, but most reviews for this set make no mention of this kind of problem.

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic