Either you have adware on your system (some piece of software that's running popping up these ads) or you are getting the net messenger popups.
For the former, install a good adware/spyware detection tool like Ad-aware 6.0 from lavasoftusa.com. I use it, works nicely and has a free version.
FOr the second, you have 2 choices:
1. Install a router or firewall that blocks access to the incoming ports 135, 136 and 445. These ports are used by the Microsoft networking protocols, one of which allows the popping up of messages. If you want to be real secure, do both. Many software firewalls have more features than you will find in typical routers (of course you many not need those features, up to you).
2. Stop the net messenger service. Issue the "net stop messenger" command. Next time you reboot it will start back up again so go into Control Panel->Services, find the messenger service and change it's startup type to "manual".