Investors & landlords

Do you still have to pay taxes even when you don't actually pull the money out of the stocks?