Buy when the capability is commodity, the market has mature solutions, and the work does not differentiate your product. Feedback collection, sprint boards, CRM, and web analytics are strong buy candidates for most teams. Build when the capability is core to your product's value proposition and no vendor can match your domain-specific requirements.
A useful test: if a competitor could buy the same tool tomorrow and close your advantage, the capability is probably commodity — buy it. If the logic is unique to your business model or data model, that is where building earns its cost. A connected product operating system like AIOProductOS takes the buy argument further: rather than buying many point tools and building integrations yourself, a single spine joins customers, revenue, feedback, and product work so the integration layer is already done.