Formal:
* Passez un excellent moment! (This is the most formal and polite way to say it.)
* Amusez-vous bien! (This is also formal, but slightly less formal than "Passez un excellent moment!")
Informal:
* Profitez bien! (This is a more casual way to say "have a great time.")
* Bonnes vacances! (This literally means "good vacation" but is used as a general "have a great time" when someone is going on holiday.)
* Bien sûr, amusez-vous bien! (This is an informal way to say "have a great time" while responding to a question or request.)
For specific situations:
* Bon concert! (Have a great concert!)
* Bon spectacle! (Have a great show!)
* Bonne soirée! (Have a great evening!)
* Bon week-end! (Have a great weekend!)
The best way to say "have a great time" in French depends on the context and your relationship with the person you are talking to.