If you're not using Google Play's tools as in Josh's answer (although, I recommend you do use those tools). You'd have to manage this information yourself.
You would want to avoid storing something locally on the user's device. Users don't want to have to pay to remove ads per device or per install.
You need to maintain a database with users who have paid. Upon launch (every time, in case they purchase the ad removal on a different device), your application checks the database, if the user account is found, you'd disable the ads permanently for that installation. The user account information should be unique to the user, ideally the Google account they used to purchase the ad removal.
When a user purchases the ad removal, you'd add their account information to the database and disable their ads.