Breast fed babies

Mariya
How long should a 5 month old be nursing for? My daughter nurses for a long time. I usually have to stop her. She always gets a tummy ache after.