If this is for Android you’ll probably be OK, but I’m pretty sure Apple won’t allow this. i.e. They’ll reject the app.
As far as implementation, simply track the date and time the app is first run in a file (saved in the documents folder). Then, when the current day is past your trial period disable your features.
That is the general approach. Specifics will depend upon your app/game.
Note: You also asked about making this secure. I wouldn’t bother. No matter what you do, the effort to make it secure will not be worth it. Those who want to cheat the system will do it.