To Configure custom domain name for statically hosted AWS S3 website you need to have a custom domain registered with AWS Route53 DNS service and you must have your bucket name same as the domain name.

Navigate to Route53 from AWS console then click on Hosted zones
Click on the domain name.
It will list other records that are already added.
Click on Create record then click on Define simple record
For Record name mention the subdomain.
For Value/Route traffic to select Alias to S3 website endpoint.
Choose the region where bucket exists and then choose the bucket from dropdown.
For Record type it will auto choose A – Route traffic to an IPv4 address and some AWS resources, if not choose it and click Define simple record

That is it after you have done the domain pointing it usually takes couple of minutes for DNS propagation and then you can access your static website using domain name.

This site will be served using HTTP protocol as there is not SSL configuration setting from S3, to configure HTTPs you will have to work with AWS CDN service Cloudfront, you can follow configure https on s3 static website to implement SSL on your static S3 site.