It depends on what one means.
Can one sin in ones thoughts? Yes. Can such be a mortal sin? Yes.
Catechism:
1853 Sins can be distinguished according to their objects, as can every human act; or according to the virtues they oppose, by excess or defect; or according to the commandments they violate. They can also be classed according to whether they concern God, neighbor, or oneself; they can be divided into spiritual and carnal sins, or again as sins in thought, word, deed, or omission. The root of sin is in the heart of man, in his free will, according to the teaching of the Lord: "For out of the heart come evil thoughts, murder, adultery, fornication, theft, false witness, slander. These are what defile a man."128 But in the heart also resides charity, the source of the good and pure works, which sin wounds.
scborromeo.org/ccc/p3s1c1a8.htm#III
Can there be good reasons for someone who is not married to think about sex? There can be.
For example a moral theologian may have to for reasonable reasons think about sexual matters that could stir up lust etc they having a sufficiently good reason might judge that they can do such while taking the needed pre-cations. He can need to give some thought to this area in his capacity as moral theologian.
But a 16 year old imagination regarding sex - that is something really to avoided… (set them aside right away if they should come…turning to something else). (not that it is to not be avoided by many others too!)
In regards to Lustful thoughts though it is important to note the need also of full knowledge and deliberate consent to be grave sins (mortal sins).
Entertaining such thoughts in a lustful way – delighting by choice (consent) in them or in a deliberate complacency in unchaste thoughts (taking delight in them)…or evil desires etc such are examples of gravely sinful internal thoughts. Ones confessor can help one in this area. (See Catholic Sexual Ethics by Lawler et all -OSV and other sources).
To have some thought go through ones mind out of the blue say – and one not consent to it but rather turn ones mind to something else – is more on the side of an act of the* virtue *of chastity --not sin.
Temptation can be just that - and set aside one can grow in the virtues of chastity and modesty.
Note too that one ought not “overly fear” their arrival either -for such fear can bring them more. Rather if they should come --simply turn your attention elsewhere.
More from the Catechism:
2520 Baptism confers on its recipient the grace of purification from all sins. But the baptized must continue to struggle against concupiscence of the flesh and disordered desires. With God’s grace he will prevail
- by the virtue and gift of chastity, for chastity lets us love with upright and undivided heart;
- by purity of intention which consists in seeking the true end of man: with simplicity of vision, the baptized person seeks to find and to fulfill God’s will in everything;313
- by purity of vision, external and internal; by discipline of feelings and imagination; by refusing all complicity in impure thoughts that incline us to turn aside from the path of God’s commandments: “Appearance arouses yearning in fools”;314
- by prayer:
I thought that continence arose from one’s own powers, which I did not recognize in myself. I was foolish enough not to know . . . that no one can be continent unless you grant it. For you would surely have granted it if my inner groaning had reached your ears and I with firm faith had cast my cares on you.315
scborromeo.org/ccc/p3s2c2a9.htm#II
(more to read there and below)
scborromeo.org/ccc/p3s2c2a6.htm#II