You have to have your own domain name to create sub-domain on it. You cannot create sub-domain on Amazon's public DNS name.
You can register for a new domain using Amazon's Route 53 service. That is the most easiest way to setup your domain name for EC2 instance as the general DNS setting is done automatically. But it is also possible to use your existing domain name register with some other domain-hosting services.
After your domain is setup with Amaonz Route 53, you can create a sub-domain from the Route 53 dashboard by adding an A record. So you will just create an A record entry where the name of the entry will be your sub-domain name, eg, "subdomain.example.com" and the value will be the public IP for your EC2 instance. Do not use the Public DNS name of your EC2 instance, because this name can be changed. It may take couple of minutes to your changes take effect.
Then you have to create name based virtual host on your EC2 instance. It may vary depending on your EC2's operating system. There are already some good tutorial out there to create name based host on different OS.