An ex post facto law is a legal document that, when it is implemented, it retroactively changes the legal consequences of certain actions undertaken before the enactment of the law. For example, in criminal law, it can modify the punishment that was decided for a crime, extending the prison sentences.
Therefore the prohibition of ex post facto laws forbids that newly-enacted laws can affect retroactively, and bring legal consequences to situations that took place before such enactment and that, when they happened, they were perfectly legal according to legislation that was operative at the moment.