Tampons

Hey ladies. Im 16 years old and got my period when i was 11. I always use tampons when i get my period and i usually change it when ive had it in for about 3 hours. 
I know quite a bit about periods but one thing i am unsure of is how long you can actually keep the tampon in for at one time? 
Thankyou xx