In this paper, we take both the centralized and distributed architectures into account in heterogenous cognitive radio networks, and study the problem of the joint transmission time and power allocation. The problem is formulated as a dual optimization problem with the optimization objective to maximize the total capacity of the secondary users (SUs) with the constraint of fairness. We first optimize the joint transmission time and power allocation for centralized SUs and propose a corresponding resource allocation scheme in the time-frequency domain. Then for the heterogeneous case with both the centralized and distributed network architecture considered, we formulate the resource allocation problem as a cooperative game and propose an iterative power water-filling scheme to get to the Nash Equilibrium (NE). Based on the dual optimization, a dynamic optimal joint transmission time and power allocation scheme for heterogenous cognitive radio networks is proposed. Extensive simulation results are presented to illustrate the performance of the proposed scheme.