How to Create a Custom Alert for long running queries from repository for SQL?

How to Create a Custom Alert for long running queries from repository for SQL?