Can I withdraw an application after filing it?
Yes, any time before a decision, but a withdrawal cannot be retracted, the fee is not refunded, and a new filing gets no credit for the old date.
Yes. Under 8 CFR 103.2(b)(6), an applicant or petitioner may withdraw a benefit request at any time until USCIS issues a decision, or, for an approved petition, until the person is admitted or granted adjustment or a change of status based on it. The catch is in the same sentence: a withdrawal may not be retracted (8 CFR 103.2).
What a withdrawal costs
The filing fee is gone. USCIS states that filing fees are final and nonrefundable regardless of any action it takes or if you withdraw the request (USCIS, Filing Fees). A new request later needs a new fee, and 8 CFR 103.2(b)(15) says the priority date or processing date of a withdrawn request may not be applied to a later application or petition. The regulation also says the facts surrounding the earlier request remain material to the new one, so a withdrawal does not wipe the record.
The same section says USCIS's acknowledgment of a withdrawal cannot be appealed.
How to withdraw
USCIS's Contact Center lists requests to withdraw an application, petition or request among the matters its first-tier representatives handle, so a call or chat with the receipt number is one route (USCIS, Contact Center). Many people instead send a signed written request to the office handling the case, with the receipt number, and keep proof of delivery. Check the notice or form instructions for the office. A request from an attorney should come with a Form G-28 on file.
Withdrawal is not the same as denial
A denial gives a written decision and usually appeal or motion rights. A withdrawal does not. A denial can follow a missed biometrics appointment or a missed Request for Evidence deadline (abandonment), and that can be answered with a motion to reopen, but a withdrawal ends the request.
Readers who answer a Request for Evidence or a Notice of Intent to Deny have three options under 8 CFR 103.2(b)(11): a complete response, a partial response asking for a decision on the record, or withdrawal. Withdrawal is therefore the third option at that point.
Who should think twice
Withdrawal can change more than the case. A person whose status depends on a pending extension, or whose work authorization depends on a pending application, may lose that protection when the case ends. For an adjustment of status applicant, a withdrawn I-485 can affect work authorization and travel permission tied to it. A person in removal proceedings has different considerations again.
What goes wrong
The common error is withdrawing to "fix a mistake" and then discovering that the old receipt date, and sometimes the status it protected, cannot be recovered. A correct approach to a mistake is usually a supplement or a correction request, not a withdrawal.
Talk to an immigration attorney before withdrawing any case that protects status, work authorization or a priority date.