I guess it would depend on what you are trying to accomplish. I would consider two scenarios:
1. You have had some less-than-stellar grades in the past, and you are trying to maximize your UG GPA. This assumes that you are doing well in classes and that you expect to achieve high grades during this extra year. In this scenario, you are maximizing your UG GPA.
2. You are staying for purely financial reasons and will be taking classes that you might not expect to do as well. In this case, you would want to get your degree first, as the lower grades over the next year would impact your UG GPA less.
I'm assuming you are under option 1, which people sometimes implement by declaring a second major and thus pushing their graduation date out.
The TLDR is that classes that are taken prior to having your degree awarded will count towards your UG GPA, and UG GPA is almost always weighted more heavily than graduate GPA.