There are two possible causes for overflowing:
1. The inlet valve is not closing, so water continues to come into the cistern and goes down through the internal overflow into the pan.
2. The outlet (flush) valve is not re-seating properly after flushing, allowing water to run straight through into the pan.
Looking at your picture, I'd suspect 1. The valve is operated by the white plastic float attached to the red plastic operating rod. (1st picture, left hand side). The float operates inside the larger white plastic "box" below it, and it looks as if the float is rubbing on the box, or rather on the accumulated limescale between the two. This would explain why it lets by, but stops after a few minutes, because the extra leverage of the higher water level may be enough to overcome the frictional resistance. So I'd suggest:
A. Clean float and the box in which it operates. Try filling the cistern with hot water and adding a limescale remove like Kilrock (Nasty fumes, so open window / good ventilation).
B. If that doesn't work, see if the water level is rising to the point where is goes down the internal overflow.
C. If so, replace the diaphragm washer in the black part immediately below the red operating rod. Or replace the inlet valve.
D. If not, suspect the flush valve. Will probably come out of its bayonet fitting at the base of the cistern by turning anti-clockwise (looking down at the top) 1/8 or 1/4 turn. Check the sealing washer, and clean / replace as necessary.
If you need new parts they will probably be specific to the cistern you have, so you'll need to try and identify make and model. I'm afraid I don't recognise it.