1 You can also cover the pan with aluminum foil, if you prefer.  Cook the squash for 30 to 45 minutes: Transfer the squash to the oven and cook for 30 to 45 minutes. Smaller squash will cook more quickly than larger squash. Check the squash after 30 minutes to gauge cooking.