There maybe two different but related things here. An Apple ID is used to access Apple's iCloud service, and Apple ID is also used to access the App Store and the iTunes Store, it is possible to use the same Apple ID for both or use different ones.
First to check to see if your iPhone currently has an iCloud account configured go to Settings -> iCloud. If a name and email address is listed under iCloud then this suggests your iPhone is logged in to iCloud. If that name and account is not yours but the sellers then only they can logout of the account and enable you to if you wish login using your own account. (iCloud is free.)
While iCloud offers a variety of services the most important one is 'Find my iPhone' this of course allows you to find your missing iPhone but also prevents someone else from wiping your phone if they find it. If it is logged in as the previous owner then you will not be able to wipe it. You might also be able to check if your phone is locked to an iCloud account via this page https://www.icloud.com/activationlock/
Apple may be simply trying to encourage you to setup iCloud.
The second possibility is that when you connect the iPhone to your computer and iTunes it is trying to sync data between the two devices particularly either Apps or music/movies purchases. In order to do this the iPhone and iTunes need to be logged in to the same account i.e. Apple ID. This might therefore prompt a message.