It's probably something to do with the type of wifi protocol used. I would start at the router, see if you can see the protocol used (wep/wpa2 etc) for that particular SSID you are trying to connect to then check on the tv when attempting to connect. Have a look at the other devices connected to your router in the wifi listings when connecting to router over a browser and see how they are connected then do the same in the Samsung menus. Also check the firewall on the router if using that and see if you have something like mac address filtering set up which means only the devices in that mac address list can connect. I doubt it, just some ideas. Also the protocols have the type of wifi networks at the end of the name, ie G, N or AC. there should be some backward compatbility even if your tv/router is brand new but make sure they are able to handshake on that protocol if there is no auto setting on the router/tv for this. example: if the tv is explicitly set to AC (one of the more recent protocols) and not auto and your router is not, there might be some connection issues.
You could also run an ethernet cable if it's close to see if that works (just to eliminate any fault with the network card in the tv but then ethernet could actually work and wifi not but that has to be a rare case).