1. You want to borrow $50,000 to buy a stock that you intend to hold for a period of 10 days and where the margin interest rate is 2.58% annually. In order to calculate the cost of borrowing take the amount of money being borrowed and multiply it by the rate being charged:
$50,000 x .0258 (2.58%) = $1,290
2. Then take that number and divide it by the number of days in a year. The brokerage industry typically uses 360 days and not the expected 365 days.
$1,290 / 360 = 3.58
3. Next, multiply this number by the total number of days you have borrowed, or expect to borrow, the money on margin:
3.58 x 10 = $35.8
Using this example, it will cost you $35.8 in margin interest to borrow $50,000 for 10 days.
The interest will post to cash in your brokerage account monthly, usually first business day of month or so. Any cash credits would offset the margin loan (depositing funds, selling stock, receiving dividends, etc.).
The margin rate is subject to change (it's pegged to the Fed Funds overnight rate, which may fluctuate a couple basis points each day, but if the Fed cuts/hikes then that will have a material effect on the rate). The interest begins and ends with settlement.
Finally, you can hold the loan so long as you stay margin compliant. But if you fully max out the leverage, then if the position moves against you then you risk a margin violation and stock being liquidated to regain margin compliancy. So it would be prudent to keep a margin offer and monitor your exposure closely.