Is there any option to kill the particular process automatically if it is consuming a particular value of cpu?
No, there isn't. But you could consider setting statement_timeout, which will kill any query running longer than a certain time.