What happens will depend on the autopilot: power source (electric, hydraulic), mode (altitude hold, speed hold), etc.
If all electric, the AP will try to hold its settings until the battery dies or the other components stop feeding it inputs. However, if altitude has priority over airspeed, it may stall the airplane as it tries to hold altitude. OTOH, if minimum speed has priority over altitude, it might glide on course until it hits the ground.