T+2 refers to the two day time limit for the exchange of cash and shares between the buyer and the seller.
When you buy the stock, you own it. You can sell your shares any time you want but you must wait until settlement to use the cash proceeds for another purchase. If you do not, in the US this is called free riding and will lead to account restriction.
Per Joe Taxpayer's comment requesting additional information:
If you buy a security in the U.S. then you can sell it any time that you want whether it be seconds or months/years later.
A cash account allows you to use the available cash. That means that with T+2, the funds from a sale will not be available for two days. There is no limit to how many day trades you can make in a cash account as long as you use settled funds. For example, if you have $10,200 in your account and you pay a $10 commission per trade, in the same day you can make 10 different purchases for $1,000 and then 10 sales, in any order that you want. With a $20 round trip commission, you have used up all of your settled funds and you will have to wait 2 days until the trades settle and the funds are back in your account.
If you make more than 3 option or equity day trades in a rolling 5 business day period in a margin account, provided the number of day trades is more than six percent of the total trading activity for that same five day period then you are considered to be a Pattern Day Trader. Then, you must maintain a minimum equity of $25k in a margin account on any day that trades are made and it must be in the account prior to the day trading. If account value drops below $25k, no day trades will be allowed until the account is restored to the $25k minimum equity level. So realistically, you need a bit more than $25k to maintain the minimum.
A PDT is allowed intraday to trade four times the maintenance margin excess in the account as of the close of business of the previous day but must revert to the standard 50% overnight margin by the end of the current day. Brokers have the right to set more restrictive levels of margin (less than 4:1 leverage) and securities like leveraged ETFs require more margin.
IOW, there is no T+2 settlement. For lack of a more precise financial description, you are effectively borrowing the money from your broker until settlement but there is no margin borrowing charge.