When you sell a security it takes 3 business days for the funds to clear. You can buy another security with unsettled funds, but you can't sell that security until the original clearance date. I did not know this when I started trading and was slapped with a 90 day restrictions where I could only buy with settled funds- not fun.
For this reason, it is best to have enough money on reserve or open a margin account, though I do not recommend it.