It doesn't matter what kind of income you owe taxes for (capital gains, wages, or whatever), the rules for the underpayment penalty are the same. There are two safe harbor levels: 90% of this year's tax liability, or 100% (110% for those with AGI above $150k) of last year's tax liability.
If your withholding (from paycheck) by itself reaches either of the safe harbors by the end of the year, you do not need to have paid any estimated taxes and you won't have an underpayment penalty. You might still owe some taxes, but those would only need to be paid by the tax filing deadline (usually April 15 of the following year). So you have the option of simply increasing your withholding a sufficient amount and not need to pay estimated taxes.
If your withholding is insufficient to reach the safe harbor level, then you need to pay estimated taxes to reach the safe harbor level. If you need to pay estimated taxes, you need to pay a sufficient amount each quarter by that quarter's deadline. The due date for first, second, third, and fourth quarter estimated taxes are usually April 15, June 15, September 15, and January 15 of the following year, respectively.
There are two ways to determine whether you've paid enough estimated taxes each quarter. One is you pay 1/4 each quarter. So if you take the safe harbor level, subtract the amount of withholding you had over the year, and divide by 4, that is how much you need to have paid each quarter. The other is the Annualized Income method, which calculates how much you need to pay each quarter based on the amount of income you have up to each quarter. The Annualized Income method is more beneficial in cases when you get more income in later quarters. You can see all of these calculations on Form 2210, which calculates the underpayment penalty. So any way you do it that can get to 0 underpayment penalty, as calculated by Form 2210, means you have paid enough.
If your income was lower or about the same last year, the simplest thing to do would be to reach 100% (or 110%) of last year's tax liability, either with withholding alone, or withholding plus estimated taxes, paid 1/4 in each quarter.
If you want to reach 90% of this year's tax liability, you can do that by adjusting your withholding as you go. If you wish to reach 90% of this year's tax liability by withholding plus estimated taxes, then it's a little tricky. You don't know your tax liability this year, so doing 1/4 of your estimate of your tax liability might be risky. So if you want to pay estimated taxes based on this year's tax liability, to be safe, you should do it based on the Annualized Income method.