Heresy is the crime of proposing an unorthodox change to an established religion.
Apostasy is the crime of abandoning or renouncing a religion.