Yes, freezing the trimmings will work fine.
As for how long? Just like freezing any foodstuffs, it depends somewhat on how well you prepare it for freezing.
Something to consider, is that the trimmings will become very brittle as will the trichomes on the trimmings themselves. If you don't handle the frozen product gently you could experience some loss due to the trichs breaking off and static causing them to stick to the container you froze the trim in.