Yes. iPhone allows setting an end date and time when initially enabling location sharing with someone. This automatically disables access after the set date/time. However, you can always manually stop sharing sooner if desired.