Y-DNA is passed down from father to son, so if you are a male, you will have received your Y-DNA from your father's father's father etc. It can be used to connect with distant cousins on the direct male line. Because the surname is also passed down from father to son, Y-DNA can be very useful for people who are researching a particular surname and is used quite frequently in One-Name Studies.
The Y-DNA test has a "reach" of about 330,000 years and so can also be used for exploring the deep ancestry on your direct male line (your father's father's father etc). This will give you an indication of the route that your ancestors took during the last major human migration out of Africa.