There are many ways to do this using license master, querying Splunk's API, introspecting the license file itself, and more!
Here is one example of invoking the rest command to return license types & when they expire:
| rest /services/licenser/licenses | eval expiry=strftime(expiration_time,"%b %d, %Y") | table type expiry
You can check inside the Splunk windows in Licensing, in Splunk 6 it's under Options in the Splunk Bar, while in the previous version of Splunk it's in the Manager.
Or with a text editor you can open a file the folder \Splunk\etc\licences
...(this depend to your installation).
From Manager>License scroll to the bottom, and select details.
The info is all there.
Thanks