Your 1 appears to be trying to be a hypothetical claim about the future, but we need to change the grammar slightly:
- If P studies (or if P were to study), P should (or P would) get a good grade.
Your 2 is a counterfactual and we might tidy it up as:
- If P had studied, P would have got a good grade.
Your 3 looks like a variation on 1, but expressed indicatively. Another kind of conditional is a past indicative:
- If P studied, P got a good grade.
4 differs from 2 because it would be used in situations where it is possible that P did study (maybe we don't know) and if P did actually study then P got a good grade. 2 on the other hand suggests we know P didn't study but would have got a good grade if they had.
Conditionals are usually (though not always) used to express the idea that the consequent part follows from the antecedent part. This 'following from' may be logical, or causal, or legal, or practical, or any one of a number of things. The result is that contraposition often fails because it gets the connection the wrong way round. For example, in a causal case, "If the bough hadn't broken the cradle wouldn't have fallen,"
does not entail, "If the cradle hadn't fallen, the bough wouldn't have broken."
The latter gets the direction of causation wrong. This appears to be the case with your example 2, since we understand that studying is a prerequisite for getting a good grade, not a consequent of it.
Another class of cases where contraposition fails is where the conditionals are uncertain. This is because a high probability of P(B|A) does not entail a high probability of P(¬A|¬B). I might believe it highly probable that if Iceland had reached the final of the 2018 Soccer World Cup they would not have won, but not that if they had won they would not have reached the final.
Another class of cases concerns conditionals where default reasoning is being used. Very commonly we rely on things that are true by default when making statements about the real world. "If I turn the key in the ignition my car starts." But this only holds under assumed default conditions: it will fail to be true if the battery is flat, or the cables are severed, or it is too cold, or there is no fuel in the tank, or any number of other things. It is infeasible in practice to list all the circumstances under which conditional statements might fail, so we make do with defaults and we allow for exceptions as and when they show up. So we can't contrapose to get, "If my car didn't start, I didn't turn the key in the ignition". One of the exceptions may be in play.
So, contraposition is not as reliable as your logic 101 class might suggest. The same consideration applies to transitivity (or hypothetical syllogism). "If A, B" together with "if B, C" does not always entail, "if A, C". Likewise for strengthening of the antecedent (or monotonocity). "If A, C" does not always entail "if A and B, C". Uncertain conditionals can usually be handled using the probability calculus; default conditionals may be handled using non-monotonic or default logics.