Affirming the antecedent
Affirming the antecedent is an argument form which proceeds by affirming the truth of the first part (the "if" part, commonly called the antecedent) of a conditional, and concluding that the second part (the "then" part, commonly called the consequent) is true.
Many people assume that this works the other way as well, so that one could say:
But this is a Logical fallacy called Affirming the consequent. Since P entails Q, but Q does not necessarily entail P. You can see this if we simply substitute in actuall statements for P. and Q.
Sometimes P and Q entail each other, in that case we can say P if and only if Q. (Sometimes the shorthand P iff Q is used rather than writing out if and only if).