How to compute the prediction interval for unseen data?
What you are referring to is a problem of estimation regression model uncertainty. 
The uncertainty estimation method depends on the model that you are using. 
Take a look at this tutorial, it provides a detailed explanation of what to do when you are using Linear Regression. It also points to the more sophisticated paper, which describes what to do when your model is more complicated.

If you are working with Regression Trees (xgboost) this tutorial provides a code that you can use.