It is best practice for websites to have XML sitemaps, however, Google recommends to have a sitemap if the website is large (over 500 pages), is brand new and only has a few external links to it, or if the site has a lot of rich media content (video, images) or is shown in Google News.
However, even if the website has fewer than 500 pages, is well linked internally, or it doesn’t have many media files, it’s still highly recommended to have a sitemap to ensure maximum crawlability & visibility within search engines.