A whip is a person in a political party whose job is to make sure the party's members vote with the party. This happens in a legislature. Whips are a party's "enforcers", who talk to each member of the party to make sure that they vote according to the official party policy.
A whip must also make sure that the elected representatives of their party are in attendance when important votes are taken. The usage comes from the hunting term "whipping in", which means to stop hounds from wandering away from the pack.