Rarely have I heard more (and often weird) opinions on what to do at the end of a close game. Some say, "Play safe!" Others, "Go for it!" And a zillion other types of advice. The reality is that the end of a game is only different in two ways.
First, there should be no holding back on your best serves or best shots. If you have a serve that gives the opponent trouble, earlier you might not have wanted to overuse it and let him get used to it. But now is the time to use what worked before. He may know it's coming - and yet, you should probably serve it anyway. If you don't, and you lose with a weaker serve, you'll be kicking yourself afterwards, and your opponent will likely also be glad you didn't use it and wonder why you didn't. But this comes with experience - if you think the opponent is looking for that serve and so will be able to make a good return off it, then perhaps set up as if you are doing that serve and cross him up with another. While serves are the obvious example of something to use at the end, you should also bring your other winning shots into play. If the opponent had trouble earlier against your heavy push, now's the time to make him face it! (But assume he handles it this time and be ready.)
Second is the psychological aspect. Ideally, you should be calm and ready to play your best. But the reality is some players get nervous in a close game. But guess what - so does your opponent! So mentally prepare yourself for these situations, and remember the opponent faces the same thing. When serving, have confidence knowing you have control over your serve, while your opponent is under much more pressure trying to return a serve since he doesn't know what's coming. When receiving, just clear your mind and do what you do best when receiving - but don't overthink it. (If you really need help on the sports psychology side, Google it, or even "Table Tennis Sports Psychology," and lots of helpful resources will come up.)
Ultimately, regardless of the score, you want to play the highest percentage table tennis you can. If that means attacking, you should mostly be attacking whether the score is 0-0, 5-5, 8-10, 10-8, or 10-10. Play your game as that's the best way to maximize your chances of winning, no matter the score. And one last simple tip - ignore the score in a close game, and just focus on the one point. Isn't that all that matters at the time you play it?