Optocoupler 5V to STM32F407 3.3V
For example, if you have a STM32F407VE, look in the datasheet at STM32F407VE. For other models, check http://www.st.com, type your model in the search field, and download the data sheet.

For the STM32F407VE, on page 46 and further, you can find the 5V tolerant pins, in the picture below marked with red boxes (same for other models in their data sheets).