What the Apple employees told you in the Apple Store is true for almost every device, including iPhones.
The warmer it gets, the slower the device runs. The only thing that you can do about that is trying to have your device run at a lower temperature.
To do that, try not to do so many tasks with your phone simultaneously, especially if the weather is already hot and you are in a place like a car.
It is also recommended to not leave your phone in the sun for too long, as even if it is not in use, it will heat up just like everything else.
And not only will your device slow down when it is too warm, but the battery will also suffer from this and lose its charge quicker. In the worst case the capacity of your devices battery will also be decreased over time in these situations.
What is also counter productive if your phone is already running warm is to charge it the same time as this will naturally heat up your phone a little by its own.
If you want to read a little more about this subject I recommend you the following page:
Keeping iPhone, iPad, and iPod touch within acceptable operating temperatures - Apple Support
There you will find information about what heats up your phone and what temperatures are the best for iPhones to run at.