In كَمْ يَوْمًا سِرْتَ؟, the expression counts the days of the verb sirt(a); kam occupies an accusative adverbial position and yawman is its tamyīz.
In كَمْ يَوْمًا سَفَرُكَ؟, the clause instead has the noun safaruka as its topic. The duration question is a predicate, so kam occupies a nominative position.
The same yawman appears in both sentences, but the clause structure differs.