No, Team Fortress 2 won't harm your computer. It's made by Valve, a reputable studio, so the game itself is very safe to install and run. The one thing to be mindful of is its multiplayer side: stick to well-moderated servers, since shady community servers can occasionally carry risks.
In terms of performance, TF2 isn't especially demanding. If you have a decent PC, it'll run without issue, and a slightly above-average machine will run it butter-smooth. On an older or lower-end laptop, you might see some lag, especially in crowded 20-plus-player matches.
Luckily, there are easy fixes. Start by tweaking your graphics in the Video Settings, dropping model detail to around medium is a quick, effective FPS boost without looking too rough. Another popular option is downloading one of "Chris's FPS configs," which have plenty of YouTube tutorials. Depending on which config you install, you can trade a bit of visual quality for higher FPS, or the reverse.