Protecting the Atmega or auto shut down

This is quite expensive and it takes a lot of time for shipping them back and forth.

Send them an expensive bill, they will learn i the end

Is there a way to enable trough the code some protection measure like shutting down the Atmega after a certain period of time? Or ending the sketch? Or entering in some kind of safe mode?

yes, yes, no but I doubt if that is what you need (all disclaimers apply)

Your requirements are too unclear to give definitive answers especially for commercial projects - incomplete and wrong answers costs money too you know

So tell us more about what you want to protect. (and remember there is no 100% protection ever)