Universities offer various options for students who are unable or unwilling to complete a class. Most of them have a short grace period of about a week, in which a class can be dropped with no consequence at all. After this period they will often allow students to drop a class and receive a grade indicating that the class was started but not completed. Common grades indicating this are W (withdrawn), I (incomplete), and Q (quit).
A Q drop will not affect your GPA (but check with your local administration), and will usually allow you to receive a refund on tuition for that class. It will appear on your transcript, but having just one or two Q drops is not likely to count against you when future employers or graduate school looks it over. You are generally allowed to take classes that have been Q dropped over again in a later semester. However, most universities will not allow you to Q drop a course a second time, and most have strict limits on how many courses can be dropped overall -- usually between three to six. This limit may be waived if you have a good excuse.
All of this is dependent on your university's policies, and when in doubt you should check with them directly.