If you don't know something is a sin, it's objectively wrong, but not a sin for you. For example, suppose you wake up one day honestly thinking it's Saturday, prepare a nice, juicy cheeseburger, eat it, and suddenly realise it's Friday. You've committed no sin, because what you thought you were doing wasn't a sin - it isn't wrong to eat meat on a Saturday.
Or suppose you've grown up atheist and everyone around you uses the Lord's name in vain all the time, so you get used to doing so. Then you become Catholic and discover it's wrong, but it still slips out from time to time. This might be reduced to a venial sin, since you don't really mean to do it, but the habit's really hard to break.
A more serious example could be suicide. With modern psychology, we know that sometimes mental illness can make people behave in ways that aren't truly their own choosing. Someone who's depressed because the chemicals in their brain aren't working properly, and commits suicide, might not go to hell because it wasn't the full consent of the will.
Mortal sin has three elements: grave matter, full consent of the will, and full knowledge that the act is wrong. If any of these is missing, it's not mortal sin. Thus, a Protestant who, through no fault of his own, does not believe the Catholic Church is the one true church cannot be guilty of the mortal sin of heresy, because he does not know rejecting her is wrong. Ultimately, whether ignorance is vincible or invincible is known only to God, so we shouldn't rely on it as a means of salvation. God has told us how to be saved - be baptised and repent, follow His commandments, and love God and neighbour. We must be part of His body, His one, holy, catholic, and apostolic Church. This has been taught for 2000 years, so those who know of the Catholic Church, but just disagree with her for selfish reasons, are rejecting the message of God.