You need to develop a bit more your question.
In what language you plan to write your application, the process you mentioned ?
Or is a regular application in binary format you want to control it ?
It is acceptable is this application receives a TERM signal to die or it need to follow some special procedure before that ?
Anyway, the simple case is to use kill to send a TERM signal to the application.
Code:
#!/bin/bash
# the application you want to terminate after a while
prog=xclock
# the time you want to wait before killing it
time=5m
# run it in background
${prog} &
# wait...
sleep $time
# ...and kill
kill %1