Formal:
* J'ai passé un agréable moment. (I had a pleasant time.)
* J'ai beaucoup apprécié. (I enjoyed myself very much.)
Informal:
* Je me suis bien amusé(e). (I had a good time.)
* J'ai passé un bon moment. (I had a good time.)
More specific:
* Je me suis régalé(e). (I had a feast.) - Use this when you enjoyed food or a specific activity.
* J'ai bien ri. (I laughed a lot.) - Use this if you had a good time with friends or at a comedy show.
* J'ai passé une soirée formidable. (I had a wonderful evening.) - This is specific to an evening event.
The best option will depend on the situation and your relationship with the person you are speaking to.