Wow! That’s a lot of pages!
Standard free plan Netlify builds cap out at 15 minutes total, any longer than that and the build won’t complete. If your Gatsby project can crank out all 300k in less than 15 minutes, then I don’t see any reason why Netlify won’t work for you. If you need more throughput in order to complete the build faster (or bandwidth to mitigate traffic to those 300,000 pages!!!) you might be in need of one of Netlify’s enterprise offerings.
I’m sure one of Netlify’s finest can pop in and add their thoughts, but in the meantime I’d maybe run some local build tests, maybe attempt a test build on Netlify, and if things don’t seem to be running smoothly, you can check out the price schedule here: https://www.netlify.com/pricing/
Best of luck!