Your F or J visa (the sticker in your passport) is an entry document; you do not need a valid F or J visa to remain in the US. If you plan to travel outside of the US with an expired visa, you need to apply for a new visa while outside of the US unless your travels qualify for automatic visa revalidation.
For complete details about obtaining a visa, please refer to the Travel Advisory portion of our website.