Without a valid form the default rate is 30% on US-source dividends and certain interest. A completed W-8BEN with a tax identification number or foreign equivalent allows the treaty rate, often 15%, and it expires after three calendar years unless refreshed.
Capital gains on US shares are generally not subject to US withholding for non-residents, but US estate tax can apply to US-situs assets above a very low threshold for non-residents, which is a frequently missed exposure.
Withholding suffered is usually creditable at home, subject to local rules: a UK stocks-and-shares-isa cannot reclaim it, while a Canadian rrsp is generally exempt from it by treaty.
This is general information, not tax advice, and it concerns United States withholding as it affects non-residents. Rules change and depend on your circumstances; consult a qualified professional.
Related: irs, stocks-and-shares-isa, rrsp, pfic-basics, dividend