First of all, congratulations on having a baby or being about to have a baby! It sounds like your baby is or will be cared for in a neonatal intensive care unit (NICU) which is a special area of the hospital reserved for babies who are born early. The doctors
who work in the NICU are very good at protecting these small babies, and usually the babies do quite well.
Depending on how small or how premature your baby is, there are a number of challenges they will have to overcome, such as being able to breath on its own. Additionally, there are a lot of longer term issues, such as the ability to nurse or take a bottle well, which is a skill that a premature baby may take quite a while to master. Until your baby has mastered all the skills that will allow you to safely take it home and care for it, it will remain in the NICU. There is no set amount of time that is required, but many babies in the NICU do end up staying there until they have gotten about to the original due date that you had.
Talk to the NICU doctors (neonatologists) if you have more questions!