Yes, compounding frequency does have an impact on your return. In general, more frequent compounding boosts your return.
The big proviso is that you have to leave the money invested in order for it to compound. In your savings account example, that's exactly what you're doing and the more frequent payout means that the interest is itself earning interest.
When you move into stocks, it isn't quite as clean-cut as that. There are fees to consider. In most of the accounts where I am, dividend reinvestment can be set to be automatic and low-cost, but even a low cost does eat into your return. The other thing is that you won't necessarily get an exact number of shares for your dividend (you might not even get any, depending on the share price), which will throw out the calculation.
Let's take a couple of simplified examples.
Stock A costs $1 per share and dividends $0.05 per annum. You buy $1000 of it and at the end of the year, you should have 1050 shares at $1 => $1050. But, your provider charges $1 for the reinvestment. So you have $1049.
Stock B costs $1 per share and dividends $0.0125 per quarter. You buy $1000 of it and at the end of the year, you have 1044 shares and $2.82 cash => $1046.82. Ouch, the fees ate more of your return.
Stock C costs $1 per share and dividends $0.05 per annum. You buy $10000 of it and at the end of the year you should have 10499 shares at $1 => $10499.
Stock D costs $1 per share and dividends $0.0125 per quarter. You buy $10000 of it and at the end of the year you should have 10504 shares with $1.36 cash => $10505.36. The more frequent compounding has overtaken the fees and improved your return.
Of course, the people who put together the sheets that describe stocks aren't unaware that a more frequent dividend will tend to result in a higher return, but they also can't know what your particular fees will be. So they ignore it and assume that you're just taking the cash each time.
All the stocks above yield a nominal 5%, but you can see from the final numbers that that's not what you're getting unless you just collect the cash.