A testimonial is a broad type of confirmation or support for something, and they often sound a lot like this: "This is the best sandwich I've ever had! Eat here." It can also be confirmation of a truth or affirmation. It can be written or spoken aloud.
Testimonials are very simple things. They can be long and elegant or very short and easy. It's a common way to for advertisers to put a certain amount of trust and weight on their product descriptions by adding a human voice. One difficulty with testimonials is that they are easy to fake, so they cannot always be taken seriously. Yelp.com is a good example of a site that runs off of testimonials. Ratemyprofessor.com is another. Testimonials are opinion-based, and are generally flashy and catch your eye with praise.
If you are at a wedding or funeral, you can write a testimonial to share your memories or experiences with the subject. This sort of testimony would be longer, more detailed and much more personal. How you write your testimony is up to you; the best way to write a good testimony is to be honest and add your voice into it as proof that you wrote it.