My IT teacher told me that if someone is pirating either Windows XP or Vista, Microsoft can break into that person's PC, and send a program to it to deactivate Windows so that when the person next turns on their PC, they will get a big schock to find it has ''somehow deactivated itself''. Is this true?

Not really. A firewall or router would still stop them. Sure, a download could be initiated from the client and ran that deactivated Windows, but if that happened then every antivirus company would flag that as a backdoor, and Microsoft would get massive badwill and sued by countless companies. Regardless that piracy is illegal, it's also piracy that do keep Microsoft on top. A big chunk of Windows users do actually run a pirated copy, and if Microsoft enforced such a intrusive method people would abandon it fast. Or crack it .