A cash gift received while in bankruptcy may be protected, but if you were entitled to receive it before you filed this is an issue to review in more detail. It comes down to understanding if the cash gift was in fact a "gift." If there is no entitlement prior to the filing than most likely you'll be able to keep it. There are other situations to consider depending on what type of gift you received, such as an inheritance or proceeds from an insurance policy.
If you obtain property after filing for Chapter 7 bankruptcy there is a general rule that says you can keep what you acquired and it is not considered part of the estate. There are exceptions to this, especially if you acquire the right to obtain the gift before you filed your petition. Things such as a tax refund, proceeds from an accident that occurred before you filed, an inheritance from someone who passed away before your case was filed or other payments owed to you before you filed may go under review by the trustee.
If you acquire or become entitled to receive a cash gift within 180 of your filing it may be used to satisfy creditors. You may be able to have schedules amended to claim exemptions in certain situations to protect these assets. There are legal options to review that may help protect entitlements. It is best to mention entitlements before you case is filed to understand options and seek appropriate solutions.