Modern political interaction is characterized by strong partisanship and a lack of interest in information sharing and agreement across party lines. It remains largely unclear how such partisan echo chambers arise and how they coevolve with opinion formation. Here we explore the emergence of these structures through the lens of coevolutionary games. In our model, the payoff of an individual is determined jointly by the magnitude of their opinion, their degree of conformity with their social neighbors, and the benefit of having social connections. Each individual can simultaneously adjust their opinion as well as the weights of their social connections. We present and validate the conditions for the emergence of partisan echo chambers, characterizing the transition from cohesive communities with consensus to divisive networks with splitting opinions. Moreover, we apply our model to voting records of the United States House of Representatives over a timespan of decades in order to understand the influence of underlying psychological and social factors on increasing partisanship in recent years. Our work helps elucidate how the division of today has come to be and how cohesion and unity could otherwise be attained on a variety of political and social issues.