Troilus and Cressida is set during the Trojan War, and thus we can assume a partial source would be The Iliad, Homer’s epic poem (which Shakespeare probably encountered via George Chapman, whose translations began appearing in 1598). Broad strokes of the play’s plot regarding the war are taken from the poem, including the conflicts within the Greek army regarding Achilles and his reluctance to participate, as well as the minor character Thersites, a loud-mouthed Grecian soldier.
While Troilus is mentioned in The Iliad, he’s not an active character, rather an allusion made by Priam of a dead son of his. As Priam later refers to Achilles as a “boy-slaying man,” some critics have interpreted this as a reference to Troilus’ death at the hands of Achilles during the war, which occurs in the mythos that was the basis for The Iliad. This myth has Troilus definitely the son of Hecuba, queen of Troy, but with a disputed father. Because of his beauty, in some versions of the myth, he is seen as a son of Apollo, but adopted by Priam as one of his own.
There is no character by the name Cressida in The Iliad, but some critics believe Cressida to be a derivation of Chryseis, who does appear in the poem, where she is a Trojan woman, a spoil of war taken by Agamemnon. There is no connection, however, between this character and Troilus in The Iliad.