The length of time a tick stays attached depends on the tick species, tick life stage and the host immunity. It also depends on whether you do a daily tick check. Generally if undisturbed, larvae remain attached and feeding for about 3 days, nymphs for 3-4 days, and adult females for 7-10 days. Deer ticks feed a day or so faster than Lone Star ticks and American dog ticks. You might be interested in our tick growth comparison pictures; ticks change their appearance pretty dramatically as they feed which can make identifying them challenging.
Host immunity also can impact duration of tick attachment as well. Prior sensitization to specific proteins in tick saliva can make it harder for ticks to ingest blood. Sometimes it causes them to stay attached a bit longer but more commonly, it makes the host itch and frequently the tick is removed by the scratching.