In civil mediation, a signed agreement is legally binding, in the same way a signed contract would be legally binding.
In family mediation, the process is a little different. In order for a divorce or custody order to become enforceable by the court, it must be filed with the court and signed off on. This is to protect the best interests of children and the rights of parties. However, if you have already reached an agreement in mediation, the process is typically much easier, faster and less expensive.