Has TF2 ever worked for you? Did you make any changes to your computer (Hardware or software) about the time you first encountered this problem?
Like Waddle Dee said it would be helpful if we knew the specs of your computer. The easiest way to do this is to click start, right click on My Computer, and click on properties. This should tell you everything you need to know.
Theres a bunch of things that can be causing this, and the best thing to do first would be to update all your drivers (Not just your graphics card ones).
Next, you might try turning off any internet security you have installed. Things like Windows Firewall or Norton Antivirus can block access to the internet for specific programs, and it may be blocking TF2's access.
If there turns out to be a major problem with TF2, you may need to reinstall the whole game. All your important data is stored in the Steam cloud so there is nothing to back up. This is a last resort and i dont recommend it because it takes a very long time.