No, it's not true that you should never tell a girl you like her. It is a personal choice and the decision is ultimately up to you, but it is generally considered healthy to express your feelings and emotions in a respectful and honest way.
If you have feelings for someone, it's important to communicate that to them so they know how you feel. Keeping your feelings to yourself could lead to missed opportunities or misunderstandings, and may cause you to miss out on a potentially fulfilling relationship.
However, it's important to be mindful of how you communicate your feelings and to respect the other person's boundaries and feelings. If they don't feel the same way, it's important to accept their decision and not pressure them or make them feel uncomfortable.