Torque is the rotational analogue of a force. In the simplest case to get a torque you need something that can rotate about a fixed point, a door for example. In the animations three different scenarios are presented, in the first case the push is applied in the longest possible arm, in the second, in the middle of the arm, and in the third at the maximum length but at an angle. The force (the blue arrow) in all three cases is the same. As you can see applying the push perpendicularly and on the longest possible arm causes the greatest movement.

You can calculate the torque by this formula: [torque] = [Force][length of arm][angle at which the force is applied]
You can see that if the lever arm is zero no rotation will happen, and the same will result if the force is applied parallel to the arm.

But objects do not necessarily need to have a fixed point about which to rotate. If an object is struck a glancing blow that object will start to rotate about its center of mass. The calculation stays the same, you just need the distance to the center of mass and the angle of impact.