Your flight from Toronto to the US will leave from the "transborder" section of Pearson Airport, not the "domestic" or "international" ones. You will go through US Immigration and Customs in Toronto (so allow time for this). Your arrival in the US will be like arriving on a US domestic flight. Assuming your flight from Toronto to India is all on one ticket, your checked bags should be checked all the way through; you will say goodbye to them in Toronto and not see them again until India.
On arriving at your US airport, you will just go to your next gate for your departure to India. Unless you're very lucky and it's in the same terminal, you will most likely have to pass through security again. This is what could take time. There are no passport or customs formalities for leaving the US.
Coming back, if you fly the same route, your bags will be tagged YYZ for Toronto. But at your first US airport, you will go through passport control, then pick up all your bags, then go through customs. After customs, there will be a "baggage recheck" area, where you just hand in your bags to be put on your next flight. You then go to your next flight, passing through security on the way. On arriving in Toronto, you will go through Canadian immigration and customs.
And yes, since you are "entering" the US in both directions, even if just for a few hours, you must find out the necessary procedures, which will depend on your citizenship.