The best way to do this, so that it won't break when you update your Moodle site to a new version, would be to create a new local plugin ( http://docs.moodle.org/dev/Local_plugins ). Then you can make use of the Moodle events API ( http://docs.moodle.org/dev/Events_API ) to subscribe to 'user_enrolled' events.
The data you get from the events API will include the field 'timeend' (from the table mdl_user_enrolments) which is the timestamp of when the enrolment will expire. If this field is '0', then it means the enrolment will not expire. If it is any other value, then you can call:
userdate($data->timeend, get_string('strftimedate'));
to format this as a date.
(See '/lang/en/langconfig.php' for other time formats you can use - note also, this date will be based on the timezone of the current logged in user - you may need to use the 'timezone' parameter of 'userdate', if you want to make sure it is the right timezone for the receiving user).