The most up-to-date docs on installing a Gatsby theme can be found on the Gatsby website, but here's a summary using this theme as an example:
yarn add theme
# or
npm install --save theme
Then edit your gatsby-config.js
file:
module.exports = {
plugins: [
{
resolve: 'theme',
options: {
basePath: '/'
}
}
]
};