There are many different ways including some "hidden" file, registry but general idea is that you need to write start date (it could also be encrypted) and check difference in days on every launch.
I've seen commercial apps allowing 15 launches (not even days).