It’s up to many factors:
You may have a limited period for an internship according the requirements from your University. That’s an important issue when we face on the search for a placement.
The companies usually prefer having students who can stay for a medium time period, from 3 to 6 months.
As a general rule, most of the companies are quite flexible about the period of time that a student can be in the company, since they understand that you have a specific training period required by your University.