Often, what one persons tells another is not hearsay and it would be admissible at trial. Most of the time it is hearsay. If it is hearsay, there are a number of exceptions to the hearsay rule that might allow it to be offered into evidence. In law school, we had an entire semester of Evidence dedicated just to the subject of hearsay. In other words, there's no quick and easy answer to your question without more info.
Hearsay is an out of court statement attesting to the truth of the matter asserted. Hearsay is inadmissible unless it meets one of the statutory exceptions for admission. For instance, a dying declaration is admissible based on the belief that a person who knows he or she is dying isn't going to lie. Another exception is the excited utterance exception--a statement made in the heat of the moment is likely trustworthy because it is not the product of reflection. Whether a statement is admissible under an exception to the hearsay rules, is often an issue of debate during trial.
The definition of hearsay is complex and convoluted; some things are hearsay for some purposes but not others, and there are many, many exceptions to the hearsay rule. You should not attempt to assess whether you can be required or permitted to testify to something without consulting with an attorney.
My colleagues have done an excellent job answering your question. For educational purposes, I will take a stab at giving you an intuitively understandable answer as well. But do not try to figure this out on your own. Hearsay rules get so complicated they make even legal professionals' heads spin.
The answer to whether you can testify to what someone else said is MAYBE. If what the other person said is hearsay, the answer is still MAYBE, as there are myriad exceptions to the hearsay rule (and those exceptions differ from state to state and the federal courts have their own rules as well).
Think of the statement you want to testify that you heard. What do you want the court to believe about that statement? Do you want the court to believe that it is a TRUE statement? Or do you want the court simply to know that that the statement was MADE? If the former, it is probably hearsay, and to be able to testify to it, you need to find one of the exceptions to the rule. If the latter, you may testify to it, as it is definitely not hearsay. (It might be inadmissible for other reasons, but I digress.)
Here are some illustrations:
"John Doe told me he was at the bank on Dec. 13." If you want the court to believe that John Doe told you the truth, and that he really was at the bank, it's hearsay. John Doe has to testify himself. Unless it fits into an exception, which is possible, but hard to see. To make it easier to see:
"John Doe told me he robbed the bank on Dec. 13." Now, if you want the court to believe that John Doe told you the truth, and that he really did rob the bank, there is an easy exception, namely, the statement is against John Doe's criminal interests. People tend not to make those kinds of statement unless they are true, so the court will admit it. (If John Doe is on trial for the robbery, it is also a Party Opponent Admission, which is also admissible.)
Now try this one: "John Doe told me he grew wings and flew to the bank." Do you want the court to believe that John Doe told the truth, and really sprouted wings and flew through the sky? No. But you still want the court to hear it anyway. Not because it is true (it can't be true), but merely because he said it. The mere fact that he said it is evidence itself. Of what? That either John Doe has a strange sense of humor or is delusional. That's not hearsay. It's only hearsay when you want the court to believe the statement is a true one.
If that helps, I am glad. If it confuses you more, believe me, all law students sympathize, and it should at least indicate why you should not try to figure out such matters without legal advice.
Dear Asker: This answer does not constitute legal advice, and I am not your attorney. No attorney-client relationship is established between me and you by my answering your question. You can receive general information about the law here on Avvo to help you understand it better, but if you want actual legal advice, call an attorney for a private, confidential consultation.