For a 10-foot square shed or other building, divide the length — 10 feet — by 2 feet (24 inches). Trusses normally are spaced 24 inches apart on board centers. Buildings with extremely high roof loads sometimes have trusses spaced at 16 inches, but few 10-foot structures will need that spacing. That division will give you the number needed for the roof length: five.
That calculation will apply for gable roofs, the most common style, with two sides that slope from a center peak; saltbox, which also has two slopes but of different lengths; or gambrel, the "barn" style, which has two slope angles on each side of the peak. Trusses for all these styles are normally spaced 24 inches apart end to end.
A hip roof, which slopes to a common eave on all four sides, will require special framing at each end, but hip roofs are rarely used on structures as small as 10 by 10 feet. A hip roof that size would use three common or gable trusses in the center, with rafters on the end to form the end slopes. Those hip rafters would need to be specially cut.
The width of the trusses for a 10-foot-wide building will depend on the pitch — the angle of slope of the roof — and the amount of eave or overhang on each wall. A typical truss with modest pitch for a 10-foot-wide building will have rafter chords 6 or 7 feet long, depending on overhang, for a total width of about 12 or 14 feet.